/node-sparkstream

Creates a node.js Stream that you can pipe things to and generate a terminal sparkline stream

Primary LanguageJavaScript

Installation

npm install sparkstream

Usage

var sparkStream = require('sparkstream');

var spark = sparkStream.createStream({
    title: 'Foo Bar Baz'
});

spark.on('data', function (chunk) {
    console.log(chunk.toString('utf8'));
});

setTimeout(function next() {
    spark.write(Math.floor(Math.random() * 100) + '');
    if (i < 100000) {
        setTimeout(next, 20);
    } else {
        spark.end();
    }
}, 250);

License

MIT.