# run-scoped

> ## Motivation

Latest version **0.1.6** (published 2022-07-08) · 0 weekly downloads

## Install

```sh
npm install run-scoped
pnpm add run-scoped
yarn add run-scoped
bun add run-scoped
```

Provides the commands `rs`, `run-scoped`.

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2022-07-08 |
| First published | 2019-04-30 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | mateja176 |

## Links

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

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^7.1.3
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [yargs](https://npm.io/package/yargs.md) ^13.2.2

## Recent versions

- 0.1.6 (latest) — 2022-07-08
- 0.1.5 — 2019-04-30
- 0.1.4 — 2019-04-30
- 0.1.3 — 2019-04-30
- 0.1.2 — 2019-04-30

## README

# Run Scoped

## Motivation

Avoid duplicating scripts in a monorepo

Manage your scripts in a centralized way using `run-scoped`

## Description

Run arbitrary script from `package.json` in any sub-directory or package

\* See how to set up a monorepo using lerna [here](https://github.com/lerna/lerna/)

## Options

```sh
rs [--scope packageNameGlob="*"] [--prefix pathToPackages="packages"]

```

## Usage

### Example Setup

#### package.json

```json
{
  "scripts": {
    "prelog:env": "cross-env FOO=prelog printenv FOO",
    "log:env": "cross-env FOO=log printenv FOO",
    "postlog:env": "cross-env FOO=postlog printenv FOO"
  }
}
```

#### packages

```txt
packages
├── common
└── greet

```

### Using run-scoped

```sh
rs log --scope greet
```

#### Outputs

<u>path-your-project/packages/greet</u>

_cross-env FOO=prelog printenv FOO_

prelog

---

<u>path-your-project/packages/greet</u>

_cross-env FOO=log printenv FOO_

log

---

<u>path-your-project/packages/greet</u>

_cross-env FOO=postlog printenv FOO_

postlog

---

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