Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

stream.transform 不能写入

let transform = new stream.Transform({
        transform(chunk, encoding, cb) {
          this.push(chunk.toString())
        }
      });
      fs
        .createReadStream('./src/index.html')
        .pipe(transform);
      // transform.write('wefwef')
      console.log(transform.read().toString())

transform.read() 返回的是null是为什么


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...