Skip to content

Txiaozhe/queue-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

queue-node

  • A simple queue structure for nodejs.

GET START

INSTALL
$ npm install queue-node --save
IMPORT and INIT and USAGE
const Queue = require('queue-node');

/**
 * size<Number>: queue size
 * callback<Function>: jobs when queue full
 *   data<Array>: the data queue
 *   onerror<Function>: callback when error
 */
const queue = new Queue(1000, (data, onerror) => {
  if (err) {
      onerror();
  }

  // do sthing
});

// push
const array = [a, b, c];
queue.push(...array);

About

A simple queue for nodejs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published