3 ms·
I've been loving using Node.js for scripts. You get all the NPM goodies plus STDIO, and they end up working just as well as shell scripts. One of the big advan
by deegles 10y ago
I've been loving using Node.js for scripts. You get all the NPM goodies plus STDIO, and they end up working just as well as shell scripts.
One of the big advantages IMO is that I only need to master one language for all of my needs, from browser to server to shell :)
- ryanbrunner 10y agoHow do you find dealing with async? Virtually everything I'd want to do with scripting would almost certainly be async in node libraries, and while I'm willing to pay the callback / promise tax in production code, for scripts it seems like the convenience of just dealing with everything synchronously would outweigh the advantage of keeping things in one language.
- deegles 10y agoIn scripts I'll keep things synchronous unless I have a specific need for async.
- jaegerpicker 10y agoPersonally for me I use es2015 and async/await in shell scripts since it's so close to writing sync code to me. I have an alias to my global babel so it's uber easy to transpile and run the code. I right a lot of node code for work so it's just native to me but I'd recommend others look into it. NPM is such an amazing ecosystem for it.
- tracker1 10y agoI tend to favor es2015 + async/await (via babel-node). Combined with bits from shelljs and mz packages, it all comes together pretty well.
- Senji 10y agoPure madness. I'm sure this is how elated the architects of the Tower of Babbel felt about themselves right before the crash.