Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egoist/dum
An npm scripts runner written in Rust.
https://github.com/egoist/dum
Last synced: 13 days ago
JSON representation
An npm scripts runner written in Rust.
- Host: GitHub
- URL: https://github.com/egoist/dum
- Owner: egoist
- License: mit
- Created: 2021-11-20T06:07:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-29T07:57:07.000Z (5 months ago)
- Last Synced: 2024-10-04T09:51:40.899Z (about 1 month ago)
- Language: Rust
- Size: 81.1 KB
- Stars: 1,516
- Watchers: 5
- Forks: 28
- Open Issues: 34
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
dum replacesnpm run
andnpx
.
Instead of waiting 200ms for your npm client to start, it will start immediately.
💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.
---
## How
This is written in Rust! (Or any compile-to-native language).
Benchmark (`hyperfine "dum foo" "npm run foo" --warmup 10`):
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
| :------------ | ----------: | -------: | -------: | ----------: |
| `dum foo` | 41.7 ± 1.2 | 39.8 | 44.6 | 1.00 |
| `npm run foo` | 333.7 ± 2.0 | 330.0 | 336.0 | 8.01 ± 0.23 |## Install
### Homebrew
```bash
brew install egoist/tap/dum
```### Shell
```bash
curl -sSL https://bina.egoist.dev/egoist/dum | sh
```### Cargo
```bash
cargo install dum
```### Scoop
```shell
scoop install dum
```### GitHub Releases
[Download a release manually](https://github.com/egoist/dum/releases) and move it to `/usr/local/bin` manually.
## Usage
`dum [...args_to_forward]`: Run npm scripts or scripts in `node_modules/.bin`, like `yarn run`, `npm run`, `npx`.
If you want to pass flags to `dum` itself, like the `-c` flag to change directory, you should put it before the script name, like `dum -c another/directory script_name --forward some_flag`.
Examples:
```bash
dum some-npm-scriptdum some-npm-script --flags will --be forwarded
# Like npx, but mush faster
dum some-npm-package-cli-name --flags will --be forwarded# Change working directory
dum -c packages/sub-package build# More
dum --help
```### Install Packages
Dum is not a package manager yet, but we forward `install`, `add`, `remove` commands to npm, pnpm and yarn automatically:
```bash
# Run `npm i` or `yarn` or `pnpm i` depending on the project
dum install # or `dum i`
# Like above but add packages
dum add react vue -Ddum remove react vue
```## Limitations
- [package.json vars](https://docs.npmjs.com/cli/v8/using-npm/scripts#packagejson-vars) are not supported, I personally never used it, if you believe it's necessary, please [leave a comment here](https://github.com/egoist/dum/issues/2).
## Inspiration
I want to try and learn Rust so I made this. Inspired by [bun](https://bun.sh/).
## Sponsors
[![sponsors](https://sponsors-images.egoist.sh/sponsors.svg)](https://github.com/sponsors/egoist)
## License
MIT © [EGOIST](https://github.com/sponsors/egoist)