This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
In July 2017 I wrote about ways to execute JavaScript snippets from your clipboard using process substitution. The snippet that I'm using since then to execute JavaScript snippets quickly is the following...
$ 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!
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Stefan Judis | Sciencx (2018-09-22T22:00:00+00:00) You can pipe into Node.js (#tilPost). Retrieved from https://www.scien.cx/2018/09/22/you-can-pipe-into-node-js-tilpost/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.