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

12 lines
300 B
JavaScript
Raw Normal View History

2019-02-17 17:07:28 +00:00
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"}