Node.js without NPM

I saw a snippet in the Bun docs that benchmarked a minimal Node.js webserver, and thought it would be interesting to see how it would work with something a little bigger than “Hello World”. It was surprising easy to do, with a lot of advantages:

  • No dependencies
  • No build step
  • Not even a package.json
  • Docker image is a single step straight from distroless
  • Node’s new --watch flag works

I am not really sure that it is practical for a real project: I wouldn’t want to have to reimplement common parsing tasks and such like. And I would probably use Bun or Deno to get built-in TypeScript support.

The source code on Github: fileformat/node-without-npm.

RSS feedSubscribe