This post is part of my Today I learned series in which I share all my learnings regarding web development.
$ 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!