nice-pipe
Nicer Node.js pipes
Last updated 5 years ago by julien-f .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nice-pipe 
SYNC missed versions from official npm registry.

nice-pipe

Build Status Dependency Status devDependency Status

Nicer Node.js pipes.

Issues with Node pipes

Errors are not forwarded

Errors are not forwarded down the chain and you must handle them on each stream or they will be thrown from the main loop.

On possible work-around is to use a dedicated domain but:

  • you should not handle continue after an error as been thrown;
  • this API is not stable;
  • it is a bit cumbersome to set up.

Streams unpipe on error

This can be a problem when you want to continue using a pipeline even if an error as occurred.

This is a common practice in build systems and gulp.js is also working on it on its side.

Not implemented yet.

Install

Download manually or with package-manager.

npm

Install globally if you want to use the CLI:

npm install --global nice-pipe

Install locally if you want to use it as a library:

npm install --save nice-pipe

Usage

var nicePipe = require('nice-pipe')

var parse = true

var pipeline = nicePipe([
  process.stdin,

  // Falsy values are silently ignored.
  parse && require('csv2json')(),

  process.stdout
]);


pipeline.on('error', function (error) {
  console.error(error)
})

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Julien Fontanet

Current Tags

  • 0.3.4                                ...           latest (5 years ago)

11 Versions

  • 0.3.4                                ...           5 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |