hijack-stream
v2.0.1
Published
Temporarily take over a readable stream
Downloads
152,346
Maintainers
Readme
hijack-stream
Temporarily take over a readable stream.
import hijackStream from 'hijack-stream';
const { restore } = hijackStream({
input: process.stdin,
ondata(chunk) { if (chunk.includes('done')) restore(); },
onend(error) { if (error !== null) console.warn(error); }
})
Why not use read
instead?
Because read
does not work inside a Node.js REPL.
LICENSE
Apache-2.0