An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          


Logo
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?






Version


License


Issues

## 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