1 | # npmlist [![npm](https://img.shields.io/npm/v/@hankchanocd/npmlist.svg)](https://www.npmjs.com/package/@hankchanocd/npmlist) [![Build Status](https://travis-ci.org/hankchanocd/npmlist.svg?branch=master)](https://travis-ci.org/hankchanocd/npmlist) [![Known Vulnerabilities](https://snyk.io/test/github/hankchanocd/npmlist/badge.svg?targetFile=package.json)](https://snyk.io/test/github/hankchanocd/npmlist?targetFile=package.json) [![Github issues](https://img.shields.io/github/issues/hankchanocd/npmlist.svg)](https://github.com/hankchanocd/npmlist/issues)
|
2 |
|
3 | > Fuzzy list anything with npm package, i.e. dependencies, installs, scripts, profile.
|
4 |
|
5 | <br />
|
6 | <br />
|
7 | <p align="center">
|
8 | <img alt="demo animation" width="700" src="https://hankchanocd.github.io/npmlist/examples/demo.svg" />
|
9 | </p>
|
10 | <br />
|
11 |
|
12 | `npmlist` or `npl` (`npl` for the sake of typing) fuzzifies all the lists it can find about a npm module using [`ipt`](https://github.com/ruyadorno/ipt#readme), making it easier for search and execution. Its default feature is local dependencies listing, but can be changed with feature flags. It has clear advantages over painfully slow and cluttered `npm list`:
|
13 |
|
14 | 1. Selecting a package on fuzzy list will automatically trigger `npm info <package>`
|
15 | 2. `npl -t` gives a quick refresher on the recent global installs
|
16 | 3. `npl -g` finds and prints global modules as fancy as `brew list`, and more than 10x faster than `npm list -g`
|
17 | 4. `npl -s` lists and triggers npm scripts better than `npm run-script`
|
18 | 5. A replacement for `npm list --depth=0 --local` and other annoyingly long `npm list --@#$%` commands with assumed configurations
|
19 | 6. No need to leave terminal just for glancing at a package's npm profile
|
20 |
|
21 | ## Install
|
22 |
|
23 | ```bash
|
24 | $ npm install -g @hankchanocd/npmlist
|
25 | ```
|
26 |
|
27 | ## Usage
|
28 |
|
29 | ```
|
30 | Usage: npl [option] [name]
|
31 |
|
32 | Fuzzy list anything with npm package
|
33 |
|
34 | Options:
|
35 |
|
36 | -v, --version output the version number
|
37 | -l, --local list local dependencies, which is also the default feature
|
38 | -g, --global list global modules
|
39 | -d, --details include details to each dependency, but disable the default fuzzy mode
|
40 | -t, --time show the latest global installs
|
41 | -s, --scripts list/execute npm scripts
|
42 | -a, --all a flavor flag that shows all available information on any feature flag
|
43 | -F, --no-fuzzy disable the default fuzzy mode and resort to stdout
|
44 | -h, --help output usage information
|
45 | ```
|
46 |
|
47 | ## Examples
|
48 |
|
49 | ### Global modules
|
50 |
|
51 | More than 10x faster than `npm list -g`
|
52 |
|
53 | ```bash
|
54 | $ npl -g
|
55 |
|
56 | ? (Use arrow keys or type to search)
|
57 | ├── @angular/cli@6.2.4
|
58 | ├── aerobatic-cli@1.1.4
|
59 | ```
|
60 |
|
61 | ### Recent added global modules
|
62 |
|
63 | A quick refresher on what the heck it's installed/upgraded globally in the recent past
|
64 |
|
65 | ```bash
|
66 | $ npl -t
|
67 |
|
68 | ? (Use arrow keys or type to search)
|
69 | @hankchanocd/npmlist 10-5 21:29
|
70 | semantic-release 10-5 8:5
|
71 | ```
|
72 |
|
73 | ### Execute module's npm scripts
|
74 |
|
75 | Somewhat similar to [`ntl`](https://github.com/ruyadorno/ntl)
|
76 |
|
77 | ```bash
|
78 | $ npl -s
|
79 |
|
80 | express@4.16.4
|
81 | ? run (Use arrow keys or type to search)
|
82 | build: babel src/ -d build/ --quiet
|
83 | test: mocha
|
84 | ```
|
85 |
|
86 | ### Fetch from NPM registry
|
87 |
|
88 | `npl` fetches the module's latest version by default, unless a version is specified
|
89 |
|
90 | ```bash
|
91 | $ npl express
|
92 |
|
93 | express@4.16.4 Dependencies:
|
94 | ? (Use arrow keys or type to search)
|
95 | ├── accepts@1.3.5
|
96 | ├── array-flatten@1.1.1
|
97 | ```
|
98 |
|
99 | ### Turn off fuzzy mode
|
100 |
|
101 | Fuzzy mode is turned on in most cases, except for `--details`, where fuzzy is not optimal for multi-line text. You can also opt for `--no-fuzzy` to turn off the default fuzzy mode.
|
102 |
|
103 | ```bash
|
104 | $ npl -t --no-fuzzy
|
105 | $ npl -g --no-fuzzy
|
106 | $ npl -s --no-fuzzy
|
107 | ```
|
108 |
|
109 | <p align="center"><img src="https://github.com/hankchanocd/npmlist/blob/master/images/no-fuzzy-demo.png" width="650"></p>
|
110 |
|
111 | ### Details flag
|
112 |
|
113 | Applied to both local dependencies and global installs
|
114 |
|
115 | ```
|
116 | $ npl --details
|
117 | $ npl -g --details
|
118 | ```
|
119 |
|
120 | <p align="center"><img src="https://github.com/hankchanocd/npmlist/blob/master/images/details-flag-demo.png" width="650"></p>
|
121 |
|
122 | ## API
|
123 |
|
124 | Build a Web or CLI tool on top of `npl`'s [API](https://github.com/hankchanocd/npmlist/wiki/API).
|
125 |
|
126 | ## Tests
|
127 |
|
128 | To perform unit tests and integration tests, simply run `npm test`.
|
129 |
|
130 | ## Changelog
|
131 |
|
132 | **2018-Oct-16:** Fuzzy mode is now enabled by default. It can be turned off by `--no-fuzzy`.
|
133 |
|
134 | **2018-Oct-18:** Give up on trying to pipe output to `less`. Nodejs simply does not have good control of TTY.
|
135 |
|
136 | **2018-Oct-19:** Speed up `npmlist -g` 10x than `npm list -g`
|
137 |
|
138 | **2018-Oct-20:** `npmlist` can also be accessed via `npl`
|
139 |
|
140 | **2018-Oct-21:** The first official [API](https://github.com/hankchanocd/npmlist/wiki/API) guide released.
|
141 |
|
142 | **2018-Oct-29:** Add autocomplete.
|
143 |
|
144 | ## Contribution
|
145 |
|
146 | `npl` started off as a bunch of CLI aliases on top of `npm list` and `npm info`, but grew larger quickly. It's now very effective at checking a package's dependencies. Saying all these means we are not afraid of expanding `npl` features beyond the current realm.
|
147 |
|
148 | The roadmap for `npl` now focuses on presenting a quick and concise report on terminal with minimal commands (it means no sub-commands), freeing developers from the burden of constant switching between terminal and browser. See [Wiki](https://github.com/hankchanocd/npmlist/wiki/Wiki) for `npl`'s code architecture, developments rules, and styles. See [here](./CONTRIBUTION.md) on how to contribute.
|
149 |
|
150 | If you like the idea of fuzzy list, check out ruyadorno's [`ipt`](https://github.com/ruyadorno/ipt#readme).
|
151 |
|
152 | ## License
|
153 |
|
154 | [ISC](./LICENSE.md)
|