1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add List Top-Level NPM Dependencies as a javascript til

This commit is contained in:
jbranchaud
2018-02-21 13:45:39 -06:00
parent f5da3abc60
commit 3b32b09c89
2 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
# List Top-Level NPM Dependencies
The `npm ls` command can be used to list all dependencies for a project.
This will, however, produce an exhaustive list of all dependencies including
dependencies of dependencies. A list this large probably isn't going to be
of much use.
The `--depth` flag allows you to restrict the depth of the dependency tree
that is generated.
```bash
$ npm ls --depth=0
```
This will produce a list of only the top-level dependencies.
See `man npm-ls` for more details.