You can pipe into Node.js
- Published at
- Updated at
- Reading time
$ node <(pbpaste)
Today I came across a tweet by Julian Gruber and it turns out you use the pipe operator with the Node.js binary directly.
$ pbpaste | node
The result is the same but it looks nicer and feels better that using process substituion (
<(). I have no idea how I missed this Node.js detail and checked the previous versions of Node.js and it works going down to Node.js
v4 (that's what I have available on my machine). Good to know!