From 5f5cd8759e30df55f6aa9df1080adb7c4f786d61 Mon Sep 17 00:00:00 2001 From: Kyle Warneck Date: Thu, 7 Mar 2019 12:07:40 -0800 Subject: [PATCH] npm: remove unncessary --save flag. simplify descriptions removes unnecssary --save flag (added by default in npm > 5). Adds an example that installs a package wihtout a version since thats a simpler case. Moves the global install example down the page since it's a more complicated case Switch to the longversion of global option (`--global`) instead of `-g` to comply with styleguide Simplified description of adding dependency Switched from the terms "dependency" and "module" to "package" where possible since package is more idiomatic in this context. Remove `npm list --global` example to keep page under 8 example limit --- pages/common/npm.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pages/common/npm.md b/pages/common/npm.md index ec8883c0d..2a9054fcf 100644 --- a/pages/common/npm.md +++ b/pages/common/npm.md @@ -4,34 +4,34 @@ > Manage Node.js projects and their module dependencies. > Homepage: . -- Download and install a module globally: +- Interactively create a package.json file: -`npm install -g {{module_name}}` +`npm init` -- Download all dependencies referenced in package.json: +- Download all the packages listed as dependencies in package.json: `npm install` -- Download a given dependency required for the application to run, and add it to the package.json: +- Download a specific version of a package and add it to the list of dependencies in package.json: -`npm install {{module_name}}@{{version}} --save` +`npm install {{module_name}}@{{version}}` -- Download a given dependency for development purposes, and add it to the package.json: +- Download a package and add it to the list of dev dependencies in package.json: -`npm install {{module_name}}@{{version}} --save-dev` +`npm install {{module_name}} --save-dev` -- Uninstall a module: +- Download a package and install it globally: + +`npm install -g {{module_name}}` + +- Uninstall a package and remove it from the list of dependencies in package.json: `npm uninstall {{module_name}}` -- List a tree of installed modules referenced in package.json: +- Print a tree of installed, project-level packages: `npm list` - List top-level globally installed modules: `npm list -g --depth={{0}}` - -- Interactively create a package.json file: - -`npm init`