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

15 lines
328 B
JavaScript
Raw Normal View History

2019-02-17 17:07:28 +00:00
var es = require('..')
process.stdin
.pipe(es.map(function (data, callback) {
for (var i = 0; i < data.length; i++) {
if (data[i] == 0x61) {
data[i] = 0x41
}
}
callback(null, data)
}))
.pipe(process.stdout)
// echo abcdabcd | node map.js
// AbcdAbcd