Created
December 3, 2017 22:54
-
-
Save jameswomack/af7abc669de71589b200a8bb22631b40 to your computer and use it in GitHub Desktop.
Accept Unix pipes w/ Node.js & pure CLI coding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'foo' | node -e "let data='';process.stdin.isTTY?console.info(process.argv):process.stdin.on('readable',()=>{data+=process.stdin.read()||''}).on('end',()=>console.info(data.trim()))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment