que

queue5

a queue for nodejs

Showing:

Popularity

Downloads/wk

14

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Queue5

A simple queue for javascript. Chinese document

Install

$ npm install queue5

Use

Simple:

const queue=require('Queue5');

const arr = [];
for (let i = 0; i < 100; i += 1) {
  arr.push(1000 + i);
}
queue(arr, 10, (item, next) => {
  setTimeout((val) => {
      console.log(val);
      next();      // Here is the condition that the queue can carry out
    }, item, item);
});

Professional:

const queue=require('Queue5');

const arr = [];
for (let i = 0; i < 100; i += 1) {
  arr.push(1000 + i);
}

async function test(args) {
  const result = await queue(args, 20, (item, next) => {
    setTimeout(() => {
      next('next');      // Pass data through next()
    }, item);
  });
  console.log(result);  //The final result is an Array
}

test(arr);

License

The MIT License。Please enjoy free source。

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial