JREAM

Node on Steroids

With the popularity of the Rust language and its speed there have been some great improvements to Node utilities.

Stop using NPM

The default NPM (Node Package Manager) we all know is bulky and slow. Many years ago plenty of us switched to Yarn which had some improvements. Today we have PNPM which is twice as fast as NPM and its smart on saving disk space.

Although it has some benefits below the main one is the Content-addressable storage. This means if you create several Node projects using the same package they will all link to the same location rather than having all those duplicates filling up space.

  • Autoinstalling peers
  • Managing Node.js versions
  • Content-addressable storage
  • Patching dependencies
  • Side-effects cache
PNPM

Manage Node Versions

We can manage our node version by setting the global default or by creating an .npmrc file in a project directory.

node -v
pnpm env use --global lts

Heres an example of an .npmrc file to autoload the version:

use-node-version=12

I like ot add an alias in my .bashrc to shorten my pnpm command. I set alias pnpm=pn, but this is totally up to you.

Farm

Most of us have used Vite and its extremely fast. Some of us who love NextJS have used Turbopack which is extremely fast. We now have Farm which is perhaps the fastest bundler and HMR reloader.

When you use Farm to build and autoreload your project youll notice a speed that is on steroids! The HMR reloads have what seems to be zero delay on my medium sized projects.

Also, Farm is compatible with your Vite configuration.

FarmFE

The easiest way to get started is by running the prompt and you can select the type of project you want to create. Of course, you can do this by hand as well.

pnpm create farm@latest
# To see options
pnpm create farm@latest --help

The configuation file is in the farm.config.ts|js|mjs.