var through = require('through');
var tr = through(write, end);
function write (buf) { this.queue(buf.toString().toUpperCase()) }
function end () {}
process.stdin.pipe(tr).pipe(process.stdout);
请高手解释下这段代码中queue()的作用,之前看了些js的书,没发现js中有queue()这么个方法,懂的能不能具体讲一下queue()的作用,可以有几个参数,多谢!
https://www.npmjs.com/package/through
如果是这样... 你会发现 JS 有无数种方法... 因为... 你说的这个应该是 through 这个库的方法. 所以查文档去吧少年~