https://github.com/n4bb12/philemon
🍍 Run npm scripts like yarn
https://github.com/n4bb12/philemon
args npm run scripts short yarn
Last synced: 10 months ago
JSON representation
🍍 Run npm scripts like yarn
- Host: GitHub
- URL: https://github.com/n4bb12/philemon
- Owner: n4bb12
- License: isc
- Created: 2018-08-04T10:13:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-22T13:40:53.000Z (over 5 years ago)
- Last Synced: 2025-07-03T14:10:05.872Z (10 months ago)
- Topics: args, npm, run, scripts, short, yarn
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Philemon
Shortens npm commands to mimic how yarn runs scripts
Philemon is a short and very interesting story. I prefer my npm commands to be just as short. Who's Philemon?
## 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 -- --help
```
Unfortunately `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 --help
```
Docs: 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 philemon
```
Alias 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 --help
```
Built-in commands are preserved:
```
npm bin
npm -v
```
#
Logo made by Freepik from www.flaticon.com is licensed by CC 3.0 BY