# workspaces-run-script

> Run a script on the packages in a mono-repo.

Latest version **0.0.8** (published 2022-12-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install workspaces-run-script
pnpm add workspaces-run-script
yarn add workspaces-run-script
bun add workspaces-run-script
```

Provides the command `workspaces-run-script`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2022-12-24 |
| First published | 2022-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 76 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ncochard |

## Links

- npm: https://www.npmjs.com/package/workspaces-run-script
- Repository: https://github.com/ncochard/workspaces-run-script
- Homepage: https://github.com/ncochard/workspaces-run-script#readme
- Issues: https://github.com/ncochard/workspaces-run-script/issues
- npm.io page: https://npm.io/package/workspaces-run-script

## Dependencies (4)

- [glob](https://npm.io/package/glob.md) ^8.0.3
- [split](https://npm.io/package/split.md) ^1.0.1
- [commander](https://npm.io/package/commander.md) ^9.4.1
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.3

## Recent versions

- 0.0.8 (latest) — 2022-12-24
- 0.0.5 — 2022-12-21
- 0.0.4 — 2022-12-21
- 0.0.3 — 2022-12-21
- 0.0.2 — 2022-12-21

## README

# workspaces-run-script

Use this utility in a mono-repo. Install this utility in your mono-repo using the command `yarn add -D workspaces-run-script`.

The command `workspaces-run-script --script test --package my-app --parallel` will run the `yarn run test` command in the projects `my-app` and any other project that are dependencies of `my-app` in the mono-repo.

The command above is similar to `yarn workspaces foreach -ptR --from '{my-app}' run test` except it will not fail if one of the workspace projects does not have a `test` script.

If you are using [NX](https://nx.dev/), the command abose is also similar to `npx nx test my-app` except that you do not need to create a `nx.json` file to indicate that the `test` script should be executed on all dependencies of the `my-app` project.

    Usage: workspaces-run-script [options]

    Options:
        -s, --script <script>    name of the script to be executed on each package
        -p, --package <package>  name of the package on which to execute the script
        --parallel               executes the command on all dependencies in parallel
        --sequential             executes the command on all dependencies sequentially
        -m, --max <max>          maximum number of parallel processes
        -h, --help               display help for command

---
_Source: https://npm.io/package/workspaces-run-script · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
