1.0.6 • Published 7 years ago
philemon v1.0.6
Why
npm / pnpm
Scripts need to be prefixed with run (with few exceptions) and arguments need to be separated with double dashes:
npm run lint -- --helpUnfortunately npx only runs bins but doesn't improve scripts.
Docs: https://docs.npmjs.com/cli/run-script
Yarn
Yarn is more concise and allows directly running scripts and passing arguments:
yarn lint --helpDocs: https://yarnpkg.com/lang/en/docs/cli/run
Conclusion
To use npm with the same brevity as Yarn, use Philemon as a wrapper.
Install
npm i -g philemonAlias npm/pnpm to run through Philemon:
alias npm="philemon npm"
alias pnpm="philemon pnpm"Usage
Depending on your alias you can now use npm with the short syntax:
npm lint --helpBuilt-in commands are preserved:
npm bin
npm -vLogo made by Freepik from www.flaticon.com is licensed by CC 3.0 BY