Automatically wrap operating system commands with duplex streams.
Named after Baron Munchausen who pulled him self out of a lake by his own hair.
import { pipeline } from 'stream';
import munchhausen from 'munchhausen';
const {cat, grep} = munchhausen;
pipeline(
...await Promise.all([
cat("package.json"),
grep(echo("name"))
]),
err => console.error
).once('readable', function () {
console.log( this.read().toString()) // "name": "munchhausen",\n
})
Artwork Public Domain