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
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.