# robot3

> A functional, immutable Finite State Machine library

Latest version **1.4.0** (published 2026-10-05) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install robot3
pnpm add robot3
yarn add robot3
bun add robot3
```

## 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 | 1.4.0 |
| Published | 2026-10-05 |
| First published | 2019-09-12 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2207 |
| Author | Matthew Phillips |
| Maintainers | matthewp |
| Keywords | Finite State Machine |

## Links

- npm: https://www.npmjs.com/package/robot3
- Repository: https://github.com/matthewp/robot
- Homepage: https://github.com/matthewp/robot#readme
- Issues: https://github.com/matthewp/robot/issues
- npm.io page: https://npm.io/package/robot3

## Recent versions

- 1.4.0 (latest) — 2026-10-05
- 1.3.1 — 2026-10-05
- 1.2.0 — 2025-09-20
- 1.1.1 — 2025-02-05
- 1.1.0 — 2025-01-14
- 1.0.2 — 2024-12-27
- 1.0.1 — 2024-11-20
- 1.0.0 — 2024-11-10
- 0.4.1 — 2023-10-23
- 0.4.0 — 2023-02-02
- 0.3.2 — 2022-11-08
- 0.3.1 — 2022-05-28
- 0.3.0 — 2022-05-28
- 0.2.21 — 2021-10-15
- 0.2.19 — 2021-01-26
- … 19 more at https://npm.io/package/robot3/versions

## README

# Robot

<p align="center">
  <img 
    alt="The Robot logo, with green background."
    src="https://github.com/matthewp/robot-logo/raw/master/logo/robot-green.png"
    width="40%"
  />
</p>

A small functional and immutable Finite State Machine library. Using state machines for your components brings the declarative programming approach to application state.

See [regularhuman.dev](https://regularhuman.dev/) for the main documentation.

```js
import { createMachine, interpret, state, transition } from 'robot3';

let machine = createMachine({
  off: state(
    transition('toggle', 'on')
  ),
  on: state(
    transition('toggle', 'off')
  )
});

const service = interpret(machine, () => {
  render();
});
```

## 📚 [Documentation](https://regularhuman.dev/)

* Please star [the repository](https://github.com/matthewp/robot) on GitHub.
* [File an issue](https://github.com/matthewp/robot/issues) if you find a bug. Or better yet...
* [Submit a pull request](https://github.com/matthewp/robot/compare) to contribute.

## Testing

Tests are located in the `test/` folder. Load `test/test.html` in your browser of choice with any HTTP server you like (I use [http-server](https://www.npmjs.com/package/http-server)). Tests are written in [QUnit](https://qunitjs.com/) and are simple to understand.

## Integrations

Robot works with a variety of UI libraries, and includes integrations for React, Preact, Haunted, and more. See the [documentation](https://regularhuman.dev/docs/) to learn more.

## Tools

* Visualization of robot state machines: [robot3-viz](https://github.com/jbreckmckye/robot3-viz)

## License

BSD-2-Clause

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