I have a read stream that pipe to stdout:
const {Readable} = require('stream');
let data = `console.warn('FOO');`;
const stream = new Readable();
stream.push(data);
stream.push(null);
stream.pipe(process.stdout);
Its name is entry.js. When executing node entry.js, I can confirm that console.warn('FOO'); is successfully piped to stdout.
But when I try to pipe it into browserify, the resulting bundle doesn't contain console.warn('FOO');:
node entry.js | browserify
How can I pipe into browserify using the CLI?
Use browserify - (- means stdin):
node entry.js | browserify -
Thank you so much. Is it a standard way of piping that I don't know about or something specific to Browserify?
It's conventional in many Unixy command line tools . It is specific to Browserify in that there is some code on our side to implement this, it's not built in to node or anything. But many CLIs that take input files do support it
Good to know. Thanks for your help.
Most helpful comment
Use
browserify -(- means stdin):