Socket
Socket
Sign inDemoInstall

lei-pipe

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lei-pipe

pipe


Version published
Maintainers
1
Install size
59.4 kB
Created

Readme

Source

node-lei-pipe

流水线式执行一系列函数,可指定简单的依赖关系

var Pipe = require('lei-pipe');

var p = new Pipe();
p.add(function (data, next) {
  // ...
  next();
});
p.add('a', function (data, next) {
  // ...
  next();
});
p.add({before: ['a']}, function (data, next) {
  // ...
  next();
});
p.add('b', {after: ['a']}, function (data, next) {
  // ...
  next();
});
p.start(123, function (err, data) {
  if (err) throw err;
  console.log(data);
});

详细使用方法请参考测试文件。

Keywords

FAQs

Last updated on 10 Sep 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc