Skip to content

Node-js

Versions

Use NVM to switch between versions.

nvm use 16
Now using node v16.9.1 (npm v7.21.1)
node -v
v16.9.1
nvm use 14
Now using node v14.18.0 (npm v6.14.15)
node -v
v14.18.0

NPM

Use list-scripts and npm-list-scripts to get a list of available npm script including what each script does.

npm i -g list-scripts npm-list-scripts

Use ncu to check the packages in your package.json file and gives you major and minor package updates info.

npm i -g npm-check-updates

You can use loop and speed-test to monitor your internet speed.

loop --every 5s { date +"%T"; speed-test -b -v }

Use npm-scripts-tree to understand the dependencies between scripts calling other scripts.

npm i -g npm-scripts-tree

With npkill you can list any node_modules directories in your system and see the space they take up to delete the ones no longer needed.

npm i -g npkill