rs-runner
v1.1.5
Published
RS is a CLI tool for quickly detecting package.json scripts, and running them.
Downloads
454
Maintainers
Keywords
Readme
RS - Run Scripts CLI
Why RS?
I'm sure there are other tools that do this, but I wanted to make one that is bare bones and easy to use.
RS was created to address my frustration with working in multiple projects that use different package managers and have various scripts defined, and to provide a simple and intuitive way to list and execute npm scripts without having to remember the exact syntax or navigate through your project's configuration.
Package Manager Agnostic: RS automatically detects whether your project uses npm, yarn, pnpm, or bun, eliminating the need to remember or switch between different commands.
Quick Script Discovery: Use
rs
orrs -l
to instantly view all scripts, eliminating the need to search throughpackage.json
.Simplified Execution: Run any script with a simple
rs <script-name>
command, without needing to prefix it withnpm run
,yarn
, or other package manager-specific commands.Global Scripts: RS allows you to define and run global scripts that are not defined in your project's
package.json
, making it easy to reuse common scripts across multiple projects.
Features
- Automatically detects the package manager used in your project (npm, yarn, pnpm, or bun)
- Lists all available scripts from your
package.json
- Runs scripts with a simple command
Installation
You can use RS in two ways: by installing it globally or by using it with npx.
Global Installation
To install RS globally, use the following command:
npm install -g rs-runner
Using npx
You can also use RS without installing it globally by using npx:
npx rs-runner <script>
Replace <script>
with the name of the script you want to run.
Usage
Listing Scripts
To list all available scripts in your project, use the following command:
rs
rs -l
This will display a list of all scripts defined in your package.json
file.
Running a Script
To run a specific script, use the following command:
rs <script>
Replace <script>
with the name of the script you want to run.
Add Global Scripts
RS also supports running global scripts that are not defined in your local package.json
.
This is particularly useful for running scripts that you use across multiple projects.
To run a global script, use the following command:
`rs -a <key> <value>`
For example:
`rs -a hello "echo hello world"`
Delete Global Scripts
To delete a global script, use the following command:
`rs -d <key>`
For example:
`rs -d hello`
This will add a global script named "hello" that echoes "hello world" when run.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
Support
If you need help or have questions, please open an issue on the GitHub repository.