@sequencemedia/write
v0.0.36
Published
Intercept writes to a writable stream and duplicate them on another writable stream
Downloads
860
Readme
@sequencemedia/write
Intercept writes to a writable stream and duplicate them on another writable stream
import {
stdout,
stderr
} from 'node:process'
import {
createWriteStream
} from 'node:fs'
import write from '@sequencemedia/write'
stdout.write = write(stdout, createWriteStream('./stdout.txt'))
stderr.write = write(stderr, createWriteStream('./stderr.txt'))
console.log('Write to the console and `./stdout.txt`')
console.error('Write to the console and `./stderr.txt`')