1.0.0 • Published 4 years ago

@amraneze/sliding-window v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Sliding Window Module

GitHub Release
GitHub Issues codecov

Sliding Window is an npm module which does not process data while the queue is full.

NOTE: For each 500 ms the module is checking if the duration of each element of the queue exceeded the time limit (which is the window slide).

Installation

With NPM

$ npm install sliding-window

With Yarn

$ yarn add sliding-window

Usage

You should import the module after installing it with npm/yarn

import WindowSliding from 'sliding-window';

const windowSliding = new WindowSliding(60 * 1000, 10);

There are two paramaters in the constructor, the first one to define the time limit in seconds and the second for the maximum data that can be processed within the time limit.

Building

You can pull the project and run the following command to install the dependencies of the project:

With NPM

$ npm install

With Yarn

$ yarn install

then this command to build it:

With NPM

$ npm run build

With Yarn

$ yarn run build

Testing

With NPM

$ npm run test

With Yarn

$ yarn run test

Contributions

Contributions are always welcome via pull requests.