Tar
Tar

Reputation: 9015

With "npm list" - is there a way to use wildcard / regex?

I couldn't find a way to do e.g.:

npm list -g *json*

(Been trying npm list -g | sls json via PowerShell, but PowerShell seems to have difficulties with it as it hags for few min. after that command...)

Upvotes: 2

Views: 1483

Answers (1)

Felipe Plets
Felipe Plets

Reputation: 7510

Unfortunately there is no parameter on npm ls that enable that natively which would be a great addition.

The only solution I found so far that may help you is to use grep.

i.e.:

npm list -g | grep json

That will show only lines matching whatever you pass to grep, but that won't show the structure of dependencies correctly and then does not help to find who depends on a specific instance of that dependency, but is a start.

Upvotes: 2

Related Questions