Feed JavaScript to Node from standard input.
Section: Basics and Invocation
Run script from stdin
bash
bash
echo "console.log('hello from stdin')" | node -Explanation
Useful in pipelines or generated scripts.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Basics and Invocation