multi-write-stream
Create a writable stream that writes to multiple other writeable streams
Last updated 9 years ago by mafintosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install multi-write-stream 
SYNC missed versions from official npm registry.

multi-write-stream

Create a writable stream that writes to multiple other writeable streams

npm install multi-write-stream

build status

Usage

var multi = require('multi-write-stream')
var fs = require('fs')

var stream = multi([
  fs.createWriteStream('file-1'),
  fs.createWriteStream('file-2')
])

stream.write('hello')
stream.write('world')

stream.end(function () {
  // both file-1 and file-2 now contains 'helloworld'
})

API

stream = multi(arrayOfWritableStreams, [options])

Create a new multi write stream. Options are forwarded to the stream constructor. Other options include

{
  autoDestroy: true // destroy the stream if a child stream errors
}

objStream = multi.obj(arrayOfWritableStreams, [options])

Same as above but sets objectMode = true

stream.add(otherStream)

Add a stream after instantiating the multi writer

stream.remove(otherStream)

Remove a stream after instantiating the multi writer

License

MIT

Current Tags

  • 2.0.1                                ...           latest (9 years ago)

9 Versions

  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.4                                ...           9 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |