Node v20.6.0 released with .env support
#500 — September 5, 2023
Node v20.6.0 (Current) Released — As we teased last week, the latest Node release includes all-new built-in support for setting environment variables via .env files, so you may no longer have a need for dotenv, depending on your use case. You can now also use import.meta.resolve to get an absolute URL string to a specified module, plus there are some enhancements around module customization hooks.
Juan José and the Node.js Team
💡 If you just want to see a quick example of the .env feature in action, Phil Nash comes to the rescue here and also outlines some of the missing features.
Frontend Masters sponsor
My Node.js is a Bit Rusty.. — The tale of how replacing a Node.js module with a native Rust module resulted in a 25x perf boost for Wix. Gal shows off the details of how it came about before concluding: “If something is too slow, profile it first, then encapsulate it, and then—perhaps—consider rewriting it in Rust.”
Using Rust alongside Node is an increasingly popular technique. You can read more on the topic in Exposing a Rust Library to Node with Napi-rs or by watching ▶️ Creating Node.js libraries with Rust using Neon.
Choosing the Best Node.js Docker Image — If you feel tempted to just throw FROM node into your Dockerfile, think again – there are other options to consider. (An article we first posted in 2022 but which has had an August 2023 update.)
Liran Tal (Snyk)
Node.js v16 goes end-of-life (EOL) next week, which means all supported versions of Node will then support the Web Streams API and the Fetch API 🎉
There are all sorts of bizarrely named npm packages being published, including things like @!-!- and –hepl, in an attempt to break tools and find new security vulnerabilities.
Would you like to write GitHub Actions workflows in TypeScript rather than YAML?
How to Use SSL/TLS Pinning in Node — SSL/TLS pinning adds an extra layer of security to connections between your apps and remote servers by storing certificates and keys for connections, thus reducing the potential for MITM attacks.
How to Create a Dual-Mode Cross-Runtime Package — Specifically, supporting both ESM and CommonJS, and across runtimes like Node, Deno and the browser.
Tracking Errors in a Node App — A look at how to track errors in a Node app in a “convenient, automated, and safe way”.
Rishabh Rawat (AppSignal)
🛠 Code & Tools
Benchmarking 24 CSV Parsing Approaches — Certainly the most extensive Node.js CSV parsing benchmark I’ve seen. The author, himself the creator of the μDSV CSV parsing library, wanted to contest the common ‘lightning fast performance’ claims of other CSV parsing libaries. Unsurprisingly, μDSV tends to win in all but a couple of cases.
React Authentication — Without Complexity — Userfront streamlines authentication & access control so engineers can focus on their core business. Read the docs now.
Better SQLite3 8.6: Fast and Simple SQLite3 Library — And with good docs too. Supports a lot of SQLite specific functionality, has a synchronous API that boasts better concurrency than an async one (why?), and worker thread support. v8.6 introduces SQLite 3.43.0.
📅 Next week, Semaphore presents the online CI/CD Express Conference, an online CI/CD conference for engineering leaders (and it’s free).
💻 Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now.
📢 If you have a community related event, project, podcast, or similar, that would be of interest to Node Weekly readers, let us know by replying to this email and we may be able to run a classified listing as above for free. We want to have a good mix of community and commercial listings.
↳ MongoDB object modeling library.
↳ Define Mongoose models using TS classes.
↳ Official Oracle Database driver for Node.
↳ TypeScript framework for server-side apps.
Cloud Spanner for Node.js v7.0
↳ Node client for Google’s Cloud Spanner.
OpenAI Node 4.4
↳ Access OpenAI’s APIs from Node.
node-mssql 9.3 – Microsoft SQL Server client.