---
title: "Shell scripting in Node with zx"
publication: "Node Weekly"
issue: 418
published_at: "2021-12-16"
canonical_url: "https://nodeweekly.com/issues/418"
---

Plus what 'node:' means in imports, and NVM for Windows gets signed. |        

#​418 — December 16, 2021 

[Read on the Web](https://nodeweekly.com/issues/418)   

Node Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/pseu3rd1lxebcxi240sq.jpg)](https://www.sitepoint.com/google-zx-write-node-shell-scripts/)  

[How To Write Shell Scripts in Node with Google's `zx`](https://www.sitepoint.com/google-zx-write-node-shell-scripts/) — [zx](https://github.com/google/zx) is a utility that makes it easier to write command line scripts based around Node. This tutorial covers the basics before going on to build a command-line tool that helps bootstrap configuration for new Node projects. 

Simon Plenderleith   

[Node's New(ish) `node:` Protocol Imports](https://2ality.com/2021/12/node-protocol-imports.html) — If you want to make it really clear that a built-in Node module is being imported (and not something with the same name or that’s in `node_modules`) this is a new approach (in all recent versions of Node for ESM `import` and v14.18+ and v16+ for `import` and `require`). 

Dr. Axel Rauschmayer   [![\](https://copm.s3.amazonaws.com/b37b94ee.png)](https://frontendmasters.com/courses/developer-productivity/?utm_source=nodeweekly&utm_medium=email&utm_content=devprod) 

[New Course: Stay Productive Across Multiple Machines, Projects, and Technologies](https://frontendmasters.com/courses/developer-productivity/?utm_source=nodeweekly&utm_medium=email&utm_content=devprod) — Enhance your developer productivity with this detailed course on setting up your professional toolchain, covering Ansible, Dotfiles, Terminals, tmux, Bash, and more. 

Frontend Masters sponsor   

**IN BRIEF:** 

- The [Deno project has joined TC39](https://deno.com/blog/deno-joins-tc39) to work on the future of JavaScript from another server-side perspective.   

[Create React App 5.0: The Popular 'One Command' React App Builder](https://github.com/facebook/create-react-app/releases/tag/v5.0.0) — Few projects in the React world have been as successful as [Create React App](https://create-react-app.dev/) which has brought single command app generation to the masses. v5.0 includes fast refresh improvements, support for Tailwind, and a lot of dependency updates including webpack 5, Jest 27 and ESLint 8. You’ll need to be running Node 14+ too. 

Meta   

[Malicious npm Packages Are Now Stealing Discord Tokens](https://www.zdnet.com/article/malicious-npm-packages-stealing-discord-tokens-highlights-problem-of-malware-distribution-in-public-repositories/) — We’ve been hearing this year of compromised npm packages trying to steal people’s crypto wallet keys or to mine cryptocurrency, but JFrog researchers have now found 17 malicious packages trying to get hold of Discord chat account tokens(!) 

Jonathan Greig   

[The Ultimate Guide to Cardinality for Observability](https://go.lightstep.com/register-guide-to-cardinality-co21?utm_campaign=node&utm_source=cooper&utm_medium=Email) 

Lightstep sponsor   

[What's New in npm 8?](https://nodesource.com/blog/whats-new-in-npm-8) — [Two months ago](https://nodeweekly.com/issues/409) we mentioned the launch of npm 8 with the subtitle of _‘but it’s not a huge deal.’_ That’s why there weren’t (m)any blog posts about it, but Gabby’s made an attempt to explain what little there was. 

Gabby T   

[How To Use Postgres with Node on Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-use-postgresql-with-node-js-on-ubuntu-20-04) — DigitalOcean does a good job of funding the creation of straightforward walkthrough tutorials on various topics, and if you want to write Node code that talks to a Postgres database via the `node-postgres` package, this is a similar such effort covering every step. 

Stanley Ulili    

💻 Jobs  

[Remote Senior Backend Engineer](https://apply.workable.com/qatalog/j/60BC1B3457/) — Come and help us build the future of work. We're a friendly team working on hard problems. Node, Hapi, Postgres, Elastic, Redis. 
Qatalog   

[Find Tech Jobs with Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-nodeweekly%29&utm_content=find-your-next-job) — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers. 
Hired     

🛠 Code & Tools  

[Got 12.0: A Powerful HTTP Request Library for Node](https://github.com/sindresorhus/got) — Got is a popular HTTP request library from Sindre Sorhus (plus many contributors too, of course). [v12.0](https://github.com/sindresorhus/got/releases/tag/v12.0.0) is the first release in a fair while, it goes pure ESM, adds read timeout support, improves retry options, and includes a lot of bugfixes. 

Sindre Sorhus   

[express-validator: Express.js Middleware for Validation & Sanitizing](https://express-validator.github.io/docs/) — For when you want to validate data using [the validations provided](https://github.com/validatorjs/validator.js#validators) by `validator.js`. [GitHub repo](https://github.com/express-validator/express-validator). 

Chris O'Hara   

[A Better, More Powerful Code Search, Built by Devs to Keep You in Flow](https://about.sourcegraph.com/code-search?utm_campaign=codesearch-ddg-tofu-2021q4&utm_medium=newsletter&utm_source=node-weekly) 

Sourcegraph sponsor   

[NVM for Windows 1.1.9 Released](https://github.com/coreybutler/nvm-windows/releases/tag/1.1.9) — A Node.js version manager for Windows users which, despite the name, is a _totally_ different thing to the better known [nvm](https://github.com/nvm-sh/nvm) project. v1.1.9 is newsworthy as it’s _code signed_ – thanks to [Aaron Yong](https://github.com/ajyong) for sponsoring that. 

Corey Butler   

[fnm: A Fast, Alternative Node.js Version Manager, Built in Rust](https://github.com/Schniz/fnm) 
Gal Schlezinger   

[undici 4.12: A Modern HTTP/1.1 Client for Node](https://github.com/nodejs/undici) 
Matteo Collina and Undici contributors   

[envsafe: Avoid Accidentally Deploying Apps with Missing or Invalid Environment Variables](https://github.com/KATT/envsafe) 
Alex Johansson   

[Fastify 3.25.0: The Fast and Low Overhead Web Framework](https://github.com/fastify/fastify) 
Fastify    

**Got a new email?** You can [change your address here](https://nodeweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Node Weekly](https://nodeweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. Thanks! 

--- 

**Want to sponsor?** Email `[kristina@cooperpress.com](mailto:kristina@cooperpress.com)` for details. 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

[Stop getting this newsletter.](https://nodeweekly.com/leave/*|UID|*)
