wrap-stream
Wrap the output of a stream with a prefix and/or suffix
Last updated 10 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install wrap-stream 
SYNC missed versions from official npm registry.

wrap-stream unstable

Wrap the output of a stream with a prefix and/or suffix.

Streams2 compliant.

Usage

wrap-stream

wrap(pre, post)

Returns a through stream that adds pre before any other output and post after calling stream.end().

var wrap = require('wrap-stream')
var fs = require('fs')

fs.createReadStream(__filename)
  .pipe(wrap('hello', 'world'))
  .pipe(process.stdout)

If you'd prefer not to use either of pre or post, just pass null in its place.

var wrap = require('wrap-stream')
var fs = require('fs')

fs.createReadStream(__filename)
  .pipe(wrap(null, 'lorem ipsum'))
  .pipe(process.stdout)

License

MIT. See LICENSE.md for details.

Current Tags

  • 2.0.0                                ...           latest (10 years ago)

2 Versions

  • 2.0.0                                ...           10 years ago
  • 0.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE