---
title: "Optimizing npm script performance"
publication: "Node Weekly"
issue: 480
published_at: "2023-03-30"
canonical_url: "https://nodeweekly.com/issues/480"
---

Plus Node v16.20.0 (LTS), three years of npm at GitHub, and Mongoose looks at Cassandra. |        

#​480 — March 30, 2023 

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

⏱ **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_ 

Together with [![AppSignal logo\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,e_trim,w_700,h_120/e_make_transparent/co_white,e_outline:7/lme8p344dw1aodshz9px.png)](https://blog.appsignal.com/2023/03/22/introducing-appsignal-log-management.html?utm_source=node-weekly-sponsored&utm_medium=email&utm_campaign=2023-03-22) 

![Node.js Weekly](https://res.cloudinary.com/cpress/image/upload/v1653576619/lgfqinzbdqttwmhvljxb.png) 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/c6rlay6sh6v4bgkc3wun.jpg)](https://blog.sandworm.dev/one-in-two-new-npm-packages-is-seo-spam-right-now)  

[Are Half of New npm Packages Just Junk?](https://blog.sandworm.dev/one-in-two-new-npm-packages-is-seo-spam-right-now) — _Sandworm_ is the creator of the [Sandworm Audit](https://sandworm.dev/) 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)   

[Node v16.20.0 (LTS) Released](https://nodejs.org/en/blog/release/v16.20.0) — Not a big release. Mostly updates to dependencies like npm (to 8.19.4) and undici. The version bump is justified by the backporting of [support for externally shared JS builtins](https://github.com/nodejs/node/pull/44376). 

Beth Griggs (Node.js Team)   [![\](https://copm.s3.amazonaws.com/e384772f.png)](https://blog.appsignal.com/2023/03/22/introducing-appsignal-log-management.html?utm_source=node-weekly-sponsored&utm_medium=email&utm_campaign=2023-03-22) 

[Smooth Log Management for Node.js Developers](https://blog.appsignal.com/2023/03/22/introducing-appsignal-log-management.html?utm_source=node-weekly-sponsored&utm_medium=email&utm_campaign=2023-03-22) — 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 sponsor   

[Speeding Up the JavaScript Ecosystem: npm Scripts](https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-4/) — 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 Workers](https://blog.cloudflare.com/workers-node-js-asynclocalstorage/) — _Cloudflare Workers_ is a popular serverless platform that uses [V8 isolates](https://dev.to/tomlienard/v8-isolates-are-taking-over-the-world-3h4m) 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   

**IN BRIEF:** 

- Did you know it's been _three years_ since [npm joined GitHub?](https://github.blog/2020-03-16-npm-is-joining-github/)
- [Mongoose](https://mongoosejs.com/) is a popular library for modelling data in MongoDB from Node, but its lead maintainer, Valeri Karpov, has revealed [they're working on Cassandra support for Mongoose](https://thecodebarbarian.com/were-working-on-cassandra-support-for-mongoose.html) in the shape of [stargate-mongoose](https://www.npmjs.com/package/stargate-mongoose).
- Looking for a database option? [The Technically Database Database](https://technically.dev/database-database) provides a straighforward look at some popular options.
- Azure Functions user? Version 4 of the Node.js programming model [is currently in preview there](https://techcommunity.microsoft.com/t5/apps-on-azure-blog/azure-functions-version-4-of-the-node-js-programming-model-is-in/ba-p/3773541). This means changes to how functions are structured and defined.   

[The Landscape of npm Packages for CLI Apps](https://blog.kilpatrick.cloud/posts/node-cli-app-packages/) — 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   

[Navigate the Pitfalls and Returns of Using Node.js Worker Threads](https://snyk.io/blog/node-js-multithreading-worker-threads-pros-cons/?utm_campaign=aom-2023&utm_medium=paid-email&utm_source=cooperpress-node-weekly&utm_content=node-js-multithreading-worker-threads-pros-cons) — Review the pros and cons of worker threads, and how they differ from other multithreading implementations, in Snyk's recent Node.js article. 

Snyk sponsor   

[A Business Case for SvelteKit](https://elliscs.hashnode.dev/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   

[Understanding `module.exports` and `exports` in Node](https://www.sitepoint.com/understanding-module-exports-exports-node-js/) 
James Hibbard    

🛠 Code & Tools  

[np 7.7.0: A Better `npm publish`](https://github.com/sindresorhus/np) — 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   

[Nano JSX: A Lightweight SSR-First JSX Library](https://nanojsx.io/) — Features include no Virtual DOM, no external dependencies, on-demand hydration, and support for Node and Deno-based server-side rendering situations. 

Nano JSX   

[Concurrent.js: Load Modules into Background Threads](https://github.com/bitair-org/concurrent.js) — 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   

[React Authentication, Simplified](https://userfront.com/tutorials/react-authentication?utm_source=nodeweekly.com&utm_medium=newsletter&utm_campaign=sponsored_link&utm_content=react_authentication) 

Userfront sponsor   

[pnpm 8.1: Alternative Fast and Space Efficient Package Manager](https://github.com/pnpm/pnpm/releases/tag/v8.1.0) — _“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   

[Sharp 0.32.0: High Performance Image Processing from Node](https://github.com/lovell/sharp) — It’s been a few years since we included this properly, but it’s so good. It uses `libvips` behind the scenes to provide what it claims is ‘the fastest module to resize JPEG, PNG, WebP and TIFF images’. You can also rotate, do gamma correction, crop, etc. [Image resizing API and examples](https://sharp.pixelplumbing.com/api-resize). 

Lovell Fuller     

💻 Jobs  

[Software Engineer (Backend)](https://jobs.ashbyhq.com/stickermule/477eed3e-4aae-46e6-a8ab-0646dbfb11cd?utm_source=Cooperpress) — 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](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=easy-job-hunting) — 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:** 

- [Unfurl 6.3](https://github.com/jacktuck/unfurl)
 ↳ oEmbed, Twitter and Open Graph metadata scraper.
- [JZZ 1.6.1](https://jazz-soft.net/doc/JZZ/)
 ↳ MIDI library for Node and browsers.
- [NodeBB 2.8.10](https://github.com/NodeBB/NodeBB)
 ↳ Popular forum software. ([Demo.](https://try.nodebb.org/))
- [Moon 1.0](https://github.com/moonrepo/moon)
 ↳ Rust-powered task runner and repo management tool.
- [Strapi 4.9](https://github.com/strapi/strapi)
 ↳ Node.js-based headless CMS.
- [Prisma 4.12](https://github.com/prisma/prisma)
 ↳ Next-generation ORM for Node and TypeScript.    

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

--- 

**Sponsorship:** Email `[kristina@cooperpress.com](mailto:kristina@cooperpress.com)` for details. 

--- 

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

[Cancel your subscription](https://nodeweekly.com/leave/*|UID|*) or [change your address.](https://nodeweekly.com/edit_subscription/*|UID|*)
