From def4349e521f7d9cf5d3a45d3cc1d0c01319e2d8 Mon Sep 17 00:00:00 2001 From: Juan Date: Wed, 1 Jun 2022 09:36:32 +0200 Subject: [PATCH] npm cheatsheet --- b3-dev/node/NPM-CHEATSHEET.md | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 b3-dev/node/NPM-CHEATSHEET.md diff --git a/b3-dev/node/NPM-CHEATSHEET.md b/b3-dev/node/NPM-CHEATSHEET.md new file mode 100644 index 0000000..568c0f8 --- /dev/null +++ b/b3-dev/node/NPM-CHEATSHEET.md @@ -0,0 +1,64 @@ +# Node Package Manager (NPM) quick cheatsheet + +## get help +``` +npm -h +``` +## get help on a command +``` +$ npm -h +``` +eg : +``` +$ npm init -h +``` + +## init a project (create package.json) +``` +$ npm init +``` + +## install module globally (adds to package.json) +``` +npm i -g saxon-js +``` +or long version +``` +npm install -g saxon-js +``` + + +## install module localy (adds to package.json) +``` +npm i saxon-js +``` + +## install module localy and do not add to package json +``` +npm i --no-save saxon-js +``` + +## check all modules installed localy +``` +$ npm ls +``` + +## check all modules installed globaly +``` +$ npm ls -g +``` + +## uninstall local module +``` +npm uninstall saxon-js +``` +Shorthand `u` does NOT work + +## uninstall global module +``` +npm uninstall -g saxon-js +``` + +## sources + - https://docs.npmjs.com/cli/v6/commands/npm-install + - https://www.tutorialspoint.com/nodejs/nodejs_npm.htm \ No newline at end of file