1.0.3 • Published 7 years ago

worker-middleware v1.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

worker-middleware

const Worker = require("worker-middleware").Worker;

var w = new Worker();
w.do(function (context, next) {
  context.username = "John Doe";
  context.email = "john.doe@gmail.com";
  next();
});
w.do(function (context, next) {
  setTimeout(function () {
    context.verify_user = true;
    next();
  }, 2000);
});
w.run(function (context, err) {
  if (err) {
    return console.error(err);
  }
  console.log(context);
});

Installation

$ npm install worker-middleware --save
1.0.3

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago