# @biorate/run-context

> Contexted scenarios execution by Middleware-based template

Latest version **2.1.3** (published 2026-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @biorate/run-context
pnpm add @biorate/run-context
yarn add @biorate/run-context
bun add @biorate/run-context
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2026-10-15 |
| First published | 2024-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5 |
| Author | llevkin |
| Maintainers | llevkin |

## Links

- npm: https://www.npmjs.com/package/@biorate/run-context
- Repository: https://github.com/biorate/core
- Homepage: https://biorate.github.io/core
- Issues: https://github.com/biorate/core/issues
- npm.io page: https://npm.io/package/@biorate/run-context

## Dependencies (3)

- [@biorate/tools](https://npm.io/package/@biorate/tools.md) 3.1.3
- [@biorate/errors](https://npm.io/package/@biorate/errors.md) 3.1.2
- [@biorate/symbolic](https://npm.io/package/@biorate/symbolic.md) 3.1.2

## Recent versions

- 2.1.3 (latest) — 2026-10-15
- 2.1.2 — 2026-06-26
- 2.1.1 — 2026-06-26
- 2.1.0 — 2026-06-17
- 2.0.1 — 2026-05-16
- 2.0.0 — 2026-05-14
- 1.105.0 — 2026-04-20
- 1.104.0 — 2026-02-13
- 1.103.0 — 2026-02-10
- 1.102.1 — 2025-02-28
- 1.102.0 — 2025-02-28
- 1.100.0 — 2025-02-26
- 1.64.0 — 2024-03-20
- 1.58.0 — 2024-02-05
- 1.56.3 — 2024-01-11
- … 3 more at https://npm.io/package/@biorate/run-context/versions

## README

# Run context

Contexted scenarios execution by Middleware-based template

#### Example:

```ts
import { Scenario, Context, step } from '@biorate/run-context';

export class Scenario1 extends Scenario {
  @step()
  protected async step1() {
    this.ctx.set('step1', true);
  }

  @step()
  protected async step2() {
    this.ctx.set('step2', 1);
  }
}

export class Scenario2 extends Scenario {
  @step()
  protected async step3() {
    this.ctx.set('step3', false);
  }
}

(async () => {
  const ctx = await Context.run([Scenario1, Scenario2], { initial: 'value' });
  console.log(ctx.get<boolean>('step1')); // true
  console.log(ctx.get<number>('step2')); // 1
  console.log(ctx.get<boolean>('step3')); // false
  console.log(ctx.all()); // {
  //    'step1': true,
  //    'step2': 1,
  //    'step3': false
  //  }
})();
```

### Learn

- Documentation can be found here - [docs](https://biorate.github.io/core/modules/run_context.html).

### Release History

See the [CHANGELOG](https://github.com/biorate/core/blob/master/packages/%40biorate/run-context/CHANGELOG.md)

### License

[MIT](https://github.com/biorate/core/blob/master/packages/%40biorate/run-context/LICENSE)

Copyright (c) 2021-present [Leonid Levkin (llevkin)](mailto:llevkin@yandex.ru)

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