javascript - Purpose of through2-map -
can please explain through2-map
package of `node.js?
i have read package npm page, still purpose of through2-map
not totally clear.
thanks in advance.
its in docs. through2-map
gives more concise way achieve want.
instead of having:
function (chunk, encoding, callback) { // in through2 this.push(chunk.slice(0, 10)) return callback() }
you have shorter version:
function (chunk) { // in through2-map return chunk.slice(0, 10); }
no explicit callback calling.
Comments
Post a Comment