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 a 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.
- 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
You can use RS in two ways: by installing it globally or by using it with npx.
To install RS globally, use the following command:
npm install -g rs-runner
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.
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.
To run a specific script, use the following command:
rs <script>
Replace <script>
with the name of the script you want to run.
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"`
To delete a global script, use the following command:
`rs -d <key>`
For example:
`rs -d hello`
You can run any package manager command with rs by using the following command (as long as its not a script defined in the package.json or globally):
`rs <command>`
This will add a global script named "hello" that echoes "hello world" when run.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
If you need help or have questions, please open an issue on the GitHub repository.