OSDN Git Service

Regular updates
[twpd/master.git] / npm.md
diff --git a/npm.md b/npm.md
index 5055e24..16a0c32 100644 (file)
--- a/npm.md
+++ b/npm.md
@@ -3,19 +3,21 @@ title: npm
 category: JavaScript
 layout: 2017/sheet
 weight: -1
-updated: 2017-10-27
+updated: 2019-12-24
 ---
 
 ### Package management
 
-| Command                           | Description                        |
-| ---                               | ---                                |
-| `npm i`                           | Alias for `npm install`            |
-| `npm install`                     | Install everything in package.json |
-| ---                               | ---                                |
-| `npm install lodash`              | Install a package                  |
-| `npm install --save-dev lodash`   | Install as devDependency           |
-| `npm install --save-exact lodash` | Install with exact                 |
+| Command                           | Description                                               |
+| ---                               | ---                                                       |
+| `npm i`                           | Alias for `npm install`                                   |
+| `npm install`                     | Install everything in package.json                        |
+| `npm install --production`        | Install everything in package.json, except devDependecies |
+| ---                               | ---                                                       |  
+| `npm install lodash`              | Install a package                                         |
+| `npm install --save-dev lodash`   | Install as devDependency                                  |
+| `npm install --save-exact lodash` | Install with exact                                        |
+
 
 `--save` is the default as of npm@5. Previously, using `npm install` without `--save` doesn't update package.json.
 
@@ -39,6 +41,15 @@ updated: 2017-10-27
 | `npm i ./archive.tgz`                | Tarball                 |
 | `npm i https://site.com/archive.tgz` | Tarball via HTTP        |
 
+### Listing
+
+| Command                 | Description                                                         |
+| ---                     | ---                                                                 |
+| `npm list`              | Lists the installed versions of all dependencies in this software   | 
+| `npm list -g --depth 0` | Lists the installed versions of all globally installed packages     | 
+| `npm view`              | Lists the latest versions of all dependencies in this software      | 
+| `npm outdated`          | Lists only the dependencies in this software which are outdated     |
+
 ### Updating
 
 | Command             | Description                |
@@ -50,6 +61,12 @@ updated: 2017-10-27
 | `npm update lodash` | Update a package           |
 
 
+### Removing
+
+| Command             | Description                        |
+| ---                 | ---                                |
+| `npm rm lodash`     | Remove package production packages |
+
 ### Misc features
 
 ```bash