Upsilon-VsCode/Client/node_modules/event-stream/examples/split.js

12 lines
300 B
JavaScript
Executable File

var es = require('..')
process.stdin
.pipe(es.split(null, null, {trailing: false})) // ignore trailing empty line
.on('data', function (data) {
console.log('data: ' + data)
})
// cat data | node map.js
// data: {"foo": 1}
// data: {"foo": 2}
// data: {"foo": 3, "bar": "test"}