The Node.js best practices list gets a 2023 update

July 25, 2023 By Mark Otto 0

Node.js Weekly

The Node.js Best Practices List: 2023 Edition — A valuable, long standing resource has been “modernized to 2023 standards” (complete with recommendations of more modern libraries) with lots of work by creator Yoni and an ever growing team of contributors. The topics remain the same, however, covering areas like code style, project architecture, and taking apps into production. (If you’re already familiar with this list, you can skim through the #new and #updated hashtags on the page.)

Yoni Goldberg et al.

Microsoft TypeChat: An Approach for Type-Safe LLM Responses — It’s interesting to see a new project from Microsoft with so many prominent names attached to it, but demonstrates the huge excitement within MS for ML and large language models (LLMs). TypeChat’s goal is to work around the issue of LLMs outputting unstructured natural language and instead to direct such output into a predictable, typed form.

Hejlsberg, Lucco, Rosenwasser et al.

Node v18.17.0 (LTS) Released — Not a huge update of the LTS release, more a ‘keeping up to date’ release, but Node 18 gains Ada 2.0 (the WHATWG-compliant URL parser), as well as improvements to Web Crypto API support.

Danielle Adams

📣 Node v20.5.0 (Current) has also been released, but without any significant changes or new features.

pkg-size: Find the True Size of an npm Package — A well designed tool that can quickly show you the true size of an npm package (including dependencies) using the actual packages by npm installing them in a WebContainer-powered virtual environment, all in your browser. Hiroki has a Twitter thread where he explains more about how it works.

Hiroki Osame

ASIDES:

  • Bun is an alternative JavaScript runtime built atop WebKit’s JavaScriptCore, as opposed to Deno which uses V8, like Node. Like Deno, however, Node compatibility is important to Bun and Bun 0.7 improves Node compatibility, Vite support, implements Web Workers, and has a new --smol option to run in memory-constrained environments (it uses 1/6th as much memory in one benchmark).

  • The idea for Node to natively support .env files was first floated last year, but now there’s a pull request making progress on the matter.

  • If you’re a VS Code and TypeScript user who’s tired of lengthy, hard to decipher error messages, Pretty TypeScript Errors is a VS Code extension worth checking out.

  • North Korea’s newest export: malicious npm packages?

🛠 Code & Tools

📰 Classifieds

💻 Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now.


📧 Did you know we have a Postgres newsletter too? We cover everything from SQL through to the latest in vector storage, GIS, hosted platforms, and Postgres extensions.

Classifieds is a new way to share projects, events or services you may find useful, with a mix of free and paid options.