---
title: "A better HTTP client for Node"
publication: "Node Weekly"
issue: 393
published_at: "2021-06-17"
canonical_url: "https://nodeweekly.com/issues/393"
---

Plus explicit ES module usage, Next.js 11, and type-safe MongoDB models. |        

#​393 — June 17, 2021 

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

Node Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/fsqp821g9facilbq1b71.jpg)](https://blog.insiderattack.net/a-visual-guide-to-nodejs-streams-9d2d594a9bf5)   

[A Visual Guide to Node.js Streams](https://blog.insiderattack.net/a-visual-guide-to-nodejs-streams-9d2d594a9bf5) — Streams aren’t conceptually too difficult to grasp but some visuals fit well and certainly help. 

Deepal Jayasekara   

[Undici 4.0: An HTTP Client, Written from Scratch for Node](https://nodejs.medium.com/introducing-undici-4-1e321243e007) — The goal of this project has been to replace Node’s core HTTP library with something faster, more scalable, and without the ‘fundamental design issues’ of the core API. v4 introduces redirect support, a faster WASM-powered parser, and a native mocking layer. [GitHub repo](https://github.com/nodejs/undici). 

Nagy, Collina, et al.   [![\](https://copm.s3.amazonaws.com/e4f4a308.png)](https://dashboard.redisgreen.net/nodeweekly) 

[Redis 6.2 on RedisGreen](https://dashboard.redisgreen.net/nodeweekly) — SSL encryption, key size tracking, memory mapping, online upgrades, and more. 

RedisGreen sponsor   

[Explicit ESM in Node with `.mjs`](https://dev.to/bnb/explicit-esm-in-node-js-with-mjs-3ooh) — As you’ve probably gathered from the many links in recent issues, Node is now fully aboard the ES modules train. In this two part series, Tierney Cyren explains _explicit_ ways to determine ES module files from CommonJS files (the `.mjs` and `.cjs` extensions) and then an [_implicit_ way](https://dev.to/bnb/implicit-esm-in-node-js-with-type-module-np). 

Tierney Cyren   

[Next.js 11 Released](https://nextjs.org/blog/next-11) — The popular React framework takes some more steps forward with improved performance, Webpack 5 support, an experimental way to make Create React App apps Next.js compatible, and [Next.js Live](https://nextjs.org/blog/next-11#nextjs-live-preview-release), a preview of a way to build Next.js apps in the browser, collaboratively, with a team. 

Next.js Team   

**THAT'S A LOT..** 

- GitHub's CEO has noted that [4 billion packages are downloaded each day](https://twitter.com/natfriedman/status/1405524163268288513) from the official npm registry (about 47,000 per second).   

[A Beginner's Guide to the File System Module (`fs`)](https://catalins.tech/a-beginners-guide-to-the-file-system-module-in-nodejs) — Available as a written tutorial or a [20-minute screencast](https://www.youtube.com/watch?v=QkwHP4d01xA), as you prefer. Covers the basic ground of reading and writing files and working with directories. 

Catalin Pit   

[Creating a Serverless Function to Scrape Web Page Metadata](https://mmazzarolo.com/blog/2021-06-06-metascraper-serverless-function/) — [Metascraper](https://metascraper.js.org/#/) is a Node.js package for scraping metadata from live Web pages and this tutorial demonstrates its use via a Vercel hosted function. 

Matteo Mazzarolo   

[Why Tracing Might Replace (Almost) All Logging](https://go.lightstep.com/register-tracing-will-replace-logging-guide-co21?utm_campaign=node&utm_source=cooper&utm_medium=Email) 

Lightstep sponsor     

🛠 Code and Tools      

[NPM Global Audit: A Small Tool to Audit Globally Installed Modules](https://www.npmjs.com/package/npm-global-audit) — For when `npm audit` doesn’t reach quite far enough. 

Andrew Brey   

[Introducing Papr: Type-Safe Node.js Models for MongoDB](https://medium.com/plexlabs/papr-type-safe-node-js-models-for-mongodb-c841e8b23429) — Plex is a heavy user of MongoDB and Node.js and when they adopted TypeScript they decided they needed to create a library around the MongoDB driver that could provide strong validation of data as well as type safety through TypeScript types. 

Agachi, Vanderhooft and Martin   

[Merge Anything: Merge Objects and Other Types Recursively](https://github.com/mesqueeb/merge-anything) — If you’re looking for something that goes a bit _deeper_ than `Object.assign()`, say. 

Luca Ban   

[Search Your Code. ALL of It, Everywhere](https://about.sourcegraph.com/?utm_source=node-weekly&utm_medium=text&utm_campaign=try-sourcegraph&utm_content=try-text) — Sourcegraph is the one tool to find & fix things across all your code. Any code host, any repo, any language. [Try it now](https://about.sourcegraph.com/?utm_source=node-weekly&utm_medium=text&utm_campaign=try-sourcegraph&utm_content=try-text). 

Sourcegraph sponsor   

[gmail-tester: A Simple Node Gmail Client](https://github.com/levz0r/gmail-tester) — Poll a Gmail box for a given amount of time and return messages that pop up. The creator [uses it](https://levz0r.medium.com/how-to-poll-a-gmail-inbox-in-cypress-io-a4286cfdb888) in a testing process to see if emails arrive as they should. 

Lev Gelfenbuim   

[depcheck: A Tool to Check for Unused Dependencies](https://github.com/depcheck/depcheck) — Analyzes the dependencies in a project to see how each dependency is used, which dependencies are useless, and which are missing from `package.json`. 

Djordje Lukic and Junle Li   

[ws 7.5: A Fast and Throughly Tested WebSocket Client and Server for Node](https://github.com/websockets/ws) — Some errors now have a `code` property describing the specific type of error that has occurred. 

Einar Otto Stangvik   

[Canary in the Gold Mine v8.0](https://github.com/nodejs/citgm) — A core tool that you might not be aware of. It lets you pull down any module of your choice and test it using a specific version of Node.js. 

Node.js Project    

💻 Jobs  

[Node.js Developer at X-Team (Remote)](https://x-team.com/remote-nodejs-developer-jobs/?utm_source=cooperpress&utm_medium=email-ad&utm_campaign=node) — Join the most energizing community for developers and work on long-term projects for Riot Games, FOX, Sony, Coinbase, and more. 
X-Team   

[Find Software Engineering 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=5-minutes) — Take 5 minutes to build your free profile & start getting interviews for your next job. Companies on Hired are actively hiring right now. 
Hired      

**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|*)
