bigint-crypto-utils/node_modules/collect-all/example/object-mode.js

11 lines
275 B
JavaScript

var collectAll = require('../')
function onAllCollected (collected) {
console.log('Objects collected: ' + collected.length)
}
var stream = collectAll(onAllCollected, { objectMode: true })
stream.write({})
stream.write({})
stream.end({}) // outputs 'Objects collected: 3'