Say for example that I quite often use npm list -g -depth 0
as command, and I'd like to alias it with npm listC
or npm list -c1
.
How do I do that?
You can use npm scripts to create shortcuts for custom commands.
In your package.json
you might have:
{
"scripts": {
"listC": "npm list -g depth 0"
}
}
And you could then run it with npm run listC
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With