formatter-stream
v1.0.0
Published
Stream that transforms objects into strings using pre-defined format.
Downloads
2
Readme
formatter-stream
Stream that transforms objects into strings using pre-defined format. Useful for streaming logs.
Installation
$ npm install formatter-stream --save
Usage
var FormatterStream = require('formatter-stream');
var stream = new FormatterStream(':author wrote ":book"');
stream.on('data', function (data) {
data.toString() === 'Arthur Conan Doyle wrote "Sherlock Holmes"'; // true
});
stream.write({
author: 'Arthur Conan Doyle',
book: 'Sherlock Holmes'
});
stream.end();
Tests
$ npm test
License
formatter-stream is released under the MIT license.