1.0.0 • Published 9 years ago

formatter-stream v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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.