duplex-combination
Combine a readable and writable stream into a duplex stream
Last updated 11 years ago by aredridel .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install duplex-combination 
SYNC missed versions from official npm registry.

duplex-combination

Merge a readable and writable stream together into a duplex stream

USE

var dp = new DuplexCombination(reader, writer, options);

dp.write("data");
dp.on('readable', function() {
    dp.read(n);
})

Additional public properties

The read and write streams are exposed with the properties dp.reader and dp.writer

ERRORS

Error events include the stream that triggered the error, so you can:

dp.on('error',function(err,stream) {
    if (stream === dp.reader) {
        // error while reading
    }
    else {
        // error while writing
    }
});

Acknowledgements

Stolen shamelessly from Isaac Schuleter's duplex-passthrough module.

Current Tags

  • 1.2.1                                ...           latest (11 years ago)

6 Versions

  • 1.2.1                                ...           11 years ago
  • 1.2.0                                ...           12 years ago
  • 1.1.1                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |