'use strict';
const stream = require('stream')
let output = ""
const s = new stream.Transform({
transform(chunk, _encoding, callback) {
// synchronous transformation
callback(null, chunk);
}
})
s.on('data', function(chunk) {
output += chunk
})
s.write('abc')
console.log(output)
这会打印“abc”(无论如何都在Node.js v6.11.0中)。但保证打印“abc”吗?