Node.js Reference

Kip Landergren

(Updated: )

My cheat sheet for Node.js covering basic commands and helpful resources.

Contents

Commands

Execute (run) a JavaScript file:

$ node path/to/file.js

Package Managers

npm

npm-audit

run npm audit to review issues with dependencies.

npm-install

Note: option --save (just plain --save) has been replaced by --save-prod but a lot of instructions include it as a hedge against older npm versions. --save has the same behavior as --save-prod.

$ npm install http-proxy-middleware
$ npm install --save-dev http-proxy-middleware
$ npm install --save-prod http-proxy-middleware
$ npm install http-proxy-middleware@latest

npm-init

Creates package.json file and allows installation of modules.

npm-outdated

run npm outdated to review outdated dependencies.

npm-prune

run npm prune to ride node_modules directory of unused dependencies.

npm-uninstall

Run npm uninstall to remove packages.

Resources

Official:

Other:

FAQ

What does the @ (at sign, at symbol) mean at the beginning of package names?

It refers to scope, which allows for official packages to be scoped under their name, like @grpc/grpc-js.