Optimizing npm script performance

March 30, 2023 By Mark Otto 0

Node Weekly is moving to Tuesdays. We’re making some changes to our schedule, and since next Tuesday isn’t far away, we’re skipping next week’s issue and we’ll be back on Tuesday, April 11, 2023. See you then!
__
Peter Cooper, your editor

Node.js Weekly

Are Half of New npm Packages Just Junk?Sandworm is the creator of the Sandworm Audit package analysis tool and as part of that work, the claim is made that “more than half of all new packages” on the official npm registry are just placeholders with READMEs that contain links to various nefarious sites.

Gabi Dobocan (Sandworm)

Smooth Log Management for Node.js Developers — Unlock the power of logs with AppSignal. Find all the key information in a few clicks in our clean and intuitive interface. Monitoring doesn’t need to be a hassle, AppSignal is here to help.

AppSignal

Speeding Up the JavaScript Ecosystem: npm Scripts — The latest in a fascinating series on finding ‘low hanging fruit’ when it comes to performance. The author explains this one best himself: “‘npm scripts’ are executed by JavaScript developers … all the time. Despite their high usage they are not particularly well optimized and add about 400ms of overhead. In this article we were able to bring that down to ~22ms.”

Marvin Hagemeister

Node.js Compatibility for Cloudflare WorkersCloudflare Workers is a popular serverless platform that uses V8 isolates rather than a Node runtime. This has meant support for Node functions has been lacking, but things are changing with support for AsyncLocalStorage, EventEmitter, Buffer, assert, and parts of util now available to use with more to follow.

James M Snell

The Landscape of npm Packages for CLI Apps — If you want to create a CLI app, there are a lot of options nowadays for covering areas like pretty output, parsing arguments, and accepting user input. This post rounds up some of the options in these various areas.

Joey Kilpatrick

A Business Case for SvelteKit — A good post covering the experience of migrating from Meteor to SvelteKit, the process this team undertook, and the outcomes from both a performance and UX point of view.

Chris Ellis

???? Code & Tools

np 7.7.0: A Better npm publish — Makes the process of publishing a package smoother with an interactive UI, checks that you’re publishing the right thing, runs tests, pushes commits and tags, etc.

Sindre Sorhus

Concurrent.js: Load Modules into Background Threads — Billed as a concurrent computing approach for JavaScript environments including the browser, Node and Deno, this library lets you dynamically import modules into worker threads (in Node) or Web Workers (in the browser).

Bitair

pnpm 8.1: Alternative Fast and Space Efficient Package Manager“A new setting has been added called dedupe-direct-deps, which is disabled by default. When set to true, dependencies that are already symlinked to the root node_modules directory of the workspace will not be symlinked to subproject node_modules directories. This feature was enabled by default in v8.0.0 but caused issues, so it’s best to disable it by default”

pnpm

Software Engineer (Backend) — Join our “kick ass” team. Our software team operates from 17 countries and we’re always looking for more exceptional engineers.
Sticker Mule

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

QUICK RELEASES: