eventuate-stream
v1.0.0
Published
Create a node-style duplex stream from an eventuate
Downloads
7
Readme
eventuate-stream
Create a node-style duplex stream from an eventuate
example
var eventuate = require('eventuate'),
eventuateStream = require('eventuate-stream'),
jsonstream = require('jsonstream')
var request = eventuate()
var requestStream = eventuateStream(request)
requestStream.pipe(jsonstream.stringify(false)).pipe(process.stdout)
request(function onRequest (req) {
console.log('\nGot a request for resource: ' + req.resource)
})
requestStream.write({ resource: '/something' })
requestStream.write({ resource: '/something/else' })
api
var eventuateStream = require('eventuate-stream'),
event = require('eventuate')()
var stream = eventuateStream(event)
Create a duplex object-mode stream. Anything written to the stream will be produced by the eventuate, and anything produced by the eventuate will be readable/emitted via the stream.
install
With npm do:
npm install eventuate-stream
testing
npm test [--dot | --spec] [--grep=pattern]
Specifying --dot
or --spec
will change the output from the default TAP style.
Specifying --grep
will only run the test files that match the given pattern.
coverage
npm run coverage [--html]
This will output a textual coverage report. Including --html
will also open
an HTML coverage report in the default browser.