From 7692a0d13a01504160fa6ccb0c502ef6727d949e Mon Sep 17 00:00:00 2001 From: Igor Shubovych Date: Sat, 30 Jan 2016 15:04:30 +0200 Subject: [PATCH 1/2] npm: removed some examples and added others --- pages/common/npm.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pages/common/npm.md b/pages/common/npm.md index c8fb02003a..ac58d43e07 100644 --- a/pages/common/npm.md +++ b/pages/common/npm.md @@ -1,10 +1,7 @@ # npm -> Node package manager, to manage Node.js projects and install module dependencies. - -- Create a new project in the current folder: - -`npm init` +> JavaScript and Node.js package manager. +> Manage Node.js projects and their module dependencies. - Download all dependencies referenced in package.json: @@ -18,14 +15,14 @@ `npm install {{module_name}}@{{version}} --save` -- Set the version of the current project: +- Uninstall a module: -`npm version {{1.2.3}}` +`npm uninstall {{module_name}}` -- Publish the current project: +- List a tree of installed modules: -`npm publish` +`npm list` -- Cleanup packages (removes packages which are installed but are not listed in `package.json`): +- Interactively create a package.json file: -`npm prune` +`npm init` From f785b8d431ee5781d2826843e9ad12601070dcfe Mon Sep 17 00:00:00 2001 From: Igor Shubovych Date: Sat, 30 Jan 2016 18:15:22 +0200 Subject: [PATCH 2/2] npm: move 'npm install -g' to the top --- pages/common/npm.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/common/npm.md b/pages/common/npm.md index ac58d43e07..2a5539e757 100644 --- a/pages/common/npm.md +++ b/pages/common/npm.md @@ -3,14 +3,14 @@ > JavaScript and Node.js package manager. > Manage Node.js projects and their module dependencies. -- Download all dependencies referenced in package.json: - -`npm install` - - Download and install a module globally: `npm install -g {{module_name}}` +- Download all dependencies referenced in package.json: + +`npm install` + - Download a given dependency, and add it to the package.json: `npm install {{module_name}}@{{version}} --save`