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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -