this repo has no description
1import { Duplex } from 'node:stream'
2
3const inoutStream = new Duplex({
4 write(chunk, encoding, callback) {
5 console.log(chunk.toString())
6 callback()
7 }
8
9 read(size) {
10 this.push(String.fromCharCode(this.currentCharCode++))
11 if (this.currentCharCode > 90 ) {
12 this.push(null)
13 }
14 }
15})
16
17inoutStream.currentCharCode = 65
18
19process.stding
20 .pipe(inountStream)
21 .pipe(process.stdout)