wrap-stream

2.0.0 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    11
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    11
  • 0.0.0
    244

Package Sidebar

Install

npm i wrap-stream

Weekly Downloads

255

Version

2.0.0

License

MIT

Last publish

Collaborators

  • hughsk