superstream

0.0.1 • Public • Published

SuperStream

The Voltron of node style streams

Work in progress

Features

  • Stream mixin support
  • Read, Write and Transform support
  • Stream any data type

Stream( )

Create new stream instance

// new Stream(); can also be used
var stream = Stream();

Stream( object )

Create stream mixin from existing object. Conflicting properties will be overwritten with Stream property.

var obj = {};
Stream(obj);

stream.write( data, callback )

// TODO add docs

stream._write( data, callback ) NOT-IMPLEMENTED-YET

// TODO add docs

stream.push( data )

// TODO add docs

stream._read( size ) NOT-IMPLEMENTED-YET

// TODO add docs

stream.unshift( data ) NOT-IMPLEMENTED-YET

// TODO add docs

stream._transform( data, callback )

// TODO add docs

stream._flush( callback ) NOT-IMPLEMENTED-YET

// TODO add docs

stream.pipe( destination, [options] )

// TODO add docs

stream.unpipe( Stream ) NOT-IMPLEMENTED-YET

// TODO add docs

stream.pause()

stream.pause();

stream.resume()

stream.resume();

stream.end( data, callback ) NOT-IMPLEMENTED-YET

// TODO add docs

Events

readable NOT-IMPLEMENTED-YET

When there is data ready to be consumed, this event will fire. When this event emits, call the read() method to consume the data.

data

Emitted on data being written to the Stream. Note that adding a 'data' event listener will switch the Readable stream into "old mode", where data is emitted as soon as it is available, rather than waiting for you to call read() to consume it

error

Emitted if there was an error receiving data.

end NOT-IMPLEMENTED-YET

Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates that no more 'data' events will happen.

drain NOT-IMPLEMENTED-YET

Emitted when the stream's write queue empties and it's safe to write without buffering again. Listen for it when stream.write() returns false.

finish NOT-IMPLEMENTED-YET

When end() is called and there are no more chunks to write, this event is emitted.

pipe NOT-IMPLEMENTED-YET

Emitted when the stream is passed to a readable stream's pipe method.

unpipe NOT-IMPLEMENTED-YET

Emitted when a previously established pipe() is removed using the source Readable stream's unpipe() method.

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.12latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.12

Package Sidebar

Install

npm i superstream

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • euforic