open-index/open-npm huggingface dataset:
npm package: @journyio/ratelimiter
Description: Sliding rate limiter using Redis
Author: journy.io
Latest version: 2.0.0

[![journy.io](https://raw.githubusercontent.com/journy-io/brand/main/githubbanner.png)](https://journy.io/?utm_source=github&utm_content=readme-ratelimiter)

# Rate limiter

![npm](https://img.shields.io/npm/v/@journyio/ratelimiter?color=%234d84f5&style=flat-square)
[![npm downloads](https://img.shields.io/npm/dm/@journyio/ratelimiter?style=flat-square)](https://www.npmjs.com/package/@journyio/ratelimiter)

A sliding rate limiter using Redis. This package depends on [moment/luxon](https://github.com/moment/luxon) and [luin/ioredis](https://github.com/luin/ioredis).

We don't recommend consuming this package in plain JavaScript (to be able to use interfaces).

Inspired by these blogposts:
* https://engagor.github.io/blog/2017/05/02/sliding-window-rate-limiter-redis/
* https://engagor.github.io/blog/2018/09/11/error-internal-rate-limit-reached/

## 💾 Installation

You can use your package manager (`npm` or `yarn`) to install:

```bash
npm install --save @journyio/ratelimiter
```
or
```bash
yarn add @journyio/ratelimiter
```

## 🔌 Getting started

```ts
import Client from "ioredis";
import { Duration } from "luxon";
import { RateLimiter, RateLimiterRedis, RateLimitedResource } from "@journyio/ratelimiter";
import { ClockSystem } from "@journyio/clock";

class API {
  constructor(private readonly rateLimiter: RateLimiter) {}

  async getUser(id: UserId) {
    const resource = new RateLimitedResource(
      `API-calls-user-${id}`,
      100,
      Duration.fromObject({ minute: 1 })
    );

    const allowed = await this.rateLimiter.consume(resource);

    if (!allowed) {
      throw new Error("Rate limited!");
    }

    /* ... */
  }
}

const redis = new Client(process.env.REDIS_URL)
const rateLimiter = new RateLimiterRedis(redis, new ClockSystem());
const api = new API(rateLimiter);
const user = await api.getUser(/* ... */);
```

```ts
const resource = new RateLimitedResource(
  "API-calls-user-1313",
  100,
  Duration.fromObject({ minute: 1 })
);

const allowed = await this.rateLimiter.consume(resource);
const remainingCalls = await rateLimiter.remaining(resource);
await rateLimiter.reset(resource);
```

## 💯 Tests

To run the tests:

```bash
npm run test
```

(assuming redis runs on port 6379)

## 🔒 Security

If you discover any security related issues, please email security at journy io instead of using the issue tracker.
npm package: @journyio/user-agent-parser
Description: User-agent string parser written in TypeScript
Author: journy.io
Latest version: 1.0.2

[![journy.io](https://raw.githubusercontent.com/journy-io/brand/main/githubbanner.png)](https://journy.io/?utm_source=github&utm_content=readme-user-agent-parser)

# User Agent Parser

![npm](https://img.shields.io/npm/v/@journyio/user-agent-parser?color=%234d84f5&style=flat-square)
[![npm downloads](https://img.shields.io/npm/dm/@journyio/user-agent-parser?style=flat-square)](https://www.npmjs.com/package/@journyio/user-agent-parser)

Inspired by [faisalman/ua-parser-js](https://github.com/faisalman/ua-parser-js).

In fact, most code is copy and 🍝. We've added TypeScript types and adopted modern syntax.

We decided to publish our own version because the package was recently [highjacked](https://github.com/faisalman/ua-parser-js/issues/536).

Why choose this package over [faisalman/ua-parser-js](https://github.com/faisalman/ua-parser-js)?

* Modern syntax
* TypeScript types
* Written in TypeScript
* Not much of a target because less popular
* Drop-in replacement

Is this package maintained?

Yes and no, we won't add new devices or browsers but will fix any bugs. We should adopt [client hints](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-client-hints-06) and use this library as a fallback.

## 💾 Installation

You can use your package manager (`npm` or `yarn`) to install:

```bash
npm install --save @journyio/user-agent-parser
```
or
```bash
yarn add @journyio/user-agent-parser
```

## 🔌 Getting started

```tsx
import { parse } from "@journyio/user-agent-parser";

const result = parse("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36");

/*
{
  browser: { name: 'Chrome Headless', version: undefined, major: undefined },
  engine: { name: 'WebKit', version: '537.36' },
  os: { name: 'Linux', version: 'x86_64' },
  device: { vendor: undefined, model: undefined, type: undefined },
  cpu: { architecture: 'amd64' }
}*/
```

## 💯 Tests

To run the tests:

```bash
npm run test
```

## 🔒 Security

If you discover any security related issues, please email security at journy io instead of using the issue tracker.
npm package: @journyio/web-types
Description: TypeScript types for our website snippet
Author: journy.io
Latest version: 1.1.0

# Web types

![npm](https://img.shields.io/npm/v/@journyio/web-types?color=%234d84f5&style=flat-square)
[![npm downloads](https://img.shields.io/npm/dm/@journyio/web-types?style=flat-square)](https://www.npmjs.com/package/@journyio/web-types)

Enables type-safe usage of our website snippet. A full web SDK will be released later this year.

## 💾 Installation

You can use your package manager (`npm` or `yarn`) to install:

```bash
npm install --save @journyio/web-types
```
or
```bash
yarn add @journyio/web-types
```

## 🔌 Getting started

💡 You can find the snippet in the website settings

```ts
import "@journyio/web-types";
```

You can find documentation for the web snippet [here](https://developers.journy.io).

## 🔒 Security

If you discover any security related issues, please email security at journy io instead of using the issue tracker.
npm package: @joustrich/leaflet-headless
Description: Leaflet for node.
Author: Jan Pieter Waagmeester
Latest version: 0.3.2

Leaflet-headless
----------------

** This fork upgrades to canvas 2.3 and jsdom 13.2, which simplifies running in AWS lambda
   because canvas > 2.0 includes necessary binaries out of the box without needing to install cairo.

   Note: You will still need to install the lib on linux (or a linux Docker container) to run in lambda
         https://github.com/Automattic/node-canvas/issues/1231

[Leaflet](http://leafletjs.com) for node.

 - Has Leaflet 1.4.x as dependency.
 - Uses [jsdom](https://github.com/tmpvar/jsdom) to fake ad DOM.
 - Uses `Image` implementation and canvas from [canvas](https://github.com/LearnBoost/node-canvas).
 - Tiles, Markers and vector layers work well with [leaflet-image](https://github.com/mapbox/leaflet-image)
 - It's slow (~4s for the `examples/choropleth/` on my machine).


### Example

Run `npm install leaflet-headless` to install the package. Requiring `leaflet-headless` will introduce a global `L` which just works like in the browser.

For vector layers, make sure to use the canvas renderer if you want to use `leaflet-image`:

```JavaScript
var L = require('leaflet-headless');

var map = L.map(document.createElement('div')).setView([52, 4], 10);

var marker = L.marker([52, 4]).addTo(map);

var latlngs = [[52, 4], [54, 4], [54, 6], [52, 6], [52, 4]];
var polyline = L.polyline(latlngs).addTo(map);
```

### Setting map size

Because jsdom does not support `clientWidth`/`clientHeight`, `leaflet-headless` defaults to a map size of 1024x1024px. To adjust this size, use `L.Map.setSize(width, height)`.

```JavaScript
map.setSize(800, 600);
```

### Saving images

`leaflet-headless` adds a convenience function to `L.Map` to save the current map to an image using `leaflet-image`.

`L.Map.saveImage(filename, callback)`: Save image to `filename` and call `callback` when ready.

```JavaScript
map.saveImage('test.png', function (filename) {
    console.log('Saved map image to ' + filename);
});
```

### Other examples:
 - `examples/leaflet-image/`, using [leaflet-image](https://github.com/mapbox/leaflet-image) to output a `.png`.
 - `examples/choropleth/`, [Choropleth tutorial from leafletjs.com](http://leafletjs.com/examples/choropleth.html) using [leaflet-image](https://github.com/mapbox/leaflet-image) to output a `.png`.
 - `examples/mapbox-geojson`, use [mapbox.js](https://github.com/mapbox/mapbox.js) to render a GeoJSON file with [simplestyle](https://github.com/mapbox/simplestyle-spec) styling.

```
~/leaflet-headless$ npm install
[...]
~/leaflet-headless$ cd examples/leaflet-image/
~/leaflet-headless/examples/leaflet-image/$ node index.js
Save to image using leaflet-image...
Saved test.png
```

### Run tests

`npm test`

### Attribution
This is inspired by https://github.com/rclark/server-side-leaflet.
npm package: @joutvhu/form-json
Description: Install the following dependency
Author: Giao Ho
Latest version: 1.0.1

## Settup

Install the following dependency

```
npm i @joutvhu/form-json
```

## Using

- Use `FormJson.serialize(json_data)` method to convert json data to FormData before send request.
- Use `FormJson.deserialize(form_data)` method to convert FormData to json data on server side.
npm package: @jouwomgeving/generator-dictator
Description: Generator for Dictator components
Author: Jeroen van Leeuwen
Latest version: 0.5.0

# generator-dictator [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> Generator for Dictator components

## Installation

First, install [Yeoman](http://yeoman.io) and generator-dictator using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
nvm use
npm install -g yo
npm install -g @jouwomgeving/generator-dictator
```

Then generate your new component:

```bash
cd path/to/dictator
yo @jouwomgeving/dictator:component
```

Or your subcomponent:

```bash
cd path/to/dictator
yo @jouwomgeving/dictator:subcomponent
```

## License

MIT © [Jeroen van Leeuwen]()


[npm-image]: https://badge.fury.io/js/generator-dictator.svg
[npm-url]: https://npmjs.org/package/generator-dictator
[travis-image]: https://travis-ci.org/jouwomgeving/generator-dictator.svg?branch=master
[travis-url]: https://travis-ci.org/jouwomgeving/generator-dictator
[daviddm-image]: https://david-dm.org/jouwomgeving/generator-dictator.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/jouwomgeving/generator-dictator
[coveralls-image]: https://coveralls.io/repos/jouwomgeving/generator-dictator/badge.svg
[coveralls-url]: https://coveralls.io/r/jouwomgeving/generator-dictator
npm package: @jovanche/homestory-react-slick
Description: slick carousel for HomeStory
Author: homestory
Latest version: 1.1.1

### react-slick

[![Backers on Open Collective](https://opencollective.com/react-slick/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/react-slick/sponsors/badge.svg)](#sponsors)

##### Carousel component built with React. It is a react port of [slick carousel](http://kenwheeler.github.io/slick/)

## [Documentation](http://react-slick.neostack.com)

### Installation

**npm**

```bash
npm install react-slick --save
```

**yarn**

```bash
yarn add react-slick
```

**Also install slick-carousel for css and font**

```bash
npm install slick-carousel

// Import css files
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
```

or add cdn link in your html

```html
<link
  rel="stylesheet"
  type="text/css"
  charset="UTF-8"
  href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"
/>
<link
  rel="stylesheet"
  type="text/css"
  href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
/>
```

### [PlayGround](https://codesandbox.io/s/ppwkk5l6xx)

### Example

```js
import React from "react";
import Slider from "react-slick";

export default function SimpleSlider() {
  var settings = {
    dots: true,
    infinite: true,
    speed: 500,
    slidesToShow: 1,
    slidesToScroll: 1
  };
  return (
    <Slider {...settings}>
      <div>
        <h3>1</h3>
      </div>
      <div>
        <h3>2</h3>
      </div>
      <div>
        <h3>3</h3>
      </div>
      <div>
        <h3>4</h3>
      </div>
      <div>
        <h3>5</h3>
      </div>
      <div>
        <h3>6</h3>
      </div>
    </Slider>
  );
}
```

### Props

For all available props, go [here](https://react-slick.neostack.com/docs/api/).

### Methods

For all available methods, go [here](https://react-slick.neostack.com/docs/api#methods)

### Development

Want to run demos locally

```bash
git clone https://github.com/akiran/react-slick
cd react-slick
npm install
npm start
open http://localhost:8080
```

## Community

Join our [discord channel](https://discord.gg/z7stRE4Cyb) to discuss react-slick bugs and ask for help


## Contributing

Please see the [contributing guidelines](./CONTRIBUTING.md)