# mikro

> Mikro.js: TypeScript for microcontrollers

Latest version **0.22.0** (published 2026-09-30) · MIT license · 0 weekly downloads

## Install

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

Provides the command `mikro`.

## Health

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

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

Warnings: low downloads; no types; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.22.0 |
| Published | 2026-09-30 |
| First published | 2015-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=24.0.0 |
| Dependencies | 25 |
| Unpacked size | 27.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 16 |
| Author | Bjørge Næss <bjoerge@gmail.com> |
| Maintainers | bjoerge |
| Keywords | embedded, esp32, iot, javascript, microcontroller, mikrojs, quickjs, typescript |

## Links

- npm: https://www.npmjs.com/package/mikro
- Repository: https://github.com/mikrojs/mikro
- Homepage: https://github.com/mikrojs/mikro#readme
- Issues: https://github.com/mikrojs/mikro/issues
- npm.io page: https://npm.io/package/mikro

## Dependencies (25)

- [ink](https://npm.io/package/ink.md) ^7.1.1
- [tar](https://npm.io/package/tar.md) ^7.5.22
- [open](https://npm.io/package/open.md) ^11.0.2
- [rxjs](https://npm.io/package/rxjs.md) ^7.8.2
- [cbor2](https://npm.io/package/cbor2.md) ^2.3.0
- [react](https://npm.io/package/react.md) ^19.2.8
- [semver](https://npm.io/package/semver.md) ^7.8.5
- [figures](https://npm.io/package/figures.md) ^6.1.0
- [std-env](https://npm.io/package/std-env.md) ^4.2.0
- [env-paths](https://npm.io/package/env-paths.md) ^4.0.0
- [serialport](https://npm.io/package/serialport.md) ^13.0.0
- [@optique/run](https://npm.io/package/@optique/run.md) ^1.2.5
- [cli-spinners](https://npm.io/package/cli-spinners.md) ^3.4.0
- [preferred-pm](https://npm.io/package/preferred-pm.md) ^5.0.0
- [@optique/core](https://npm.io/package/@optique/core.md) ^1.2.5
- [@mikrojs/native](https://npm.io/package/@mikrojs/native.md) 0.22.0
- [@mikrojs/schema](https://npm.io/package/@mikrojs/schema.md) 0.22.0
- [update-notifier](https://npm.io/package/update-notifier.md) ^7.3.1
- [@mikrojs/esptool](https://npm.io/package/@mikrojs/esptool.md) 0.22.0
- [@mikrojs/quickjs](https://npm.io/package/@mikrojs/quickjs.md) 0.22.0
- [ink-select-input](https://npm.io/package/ink-select-input.md) ^6.2.0
- [@mikrojs/firmware](https://npm.io/package/@mikrojs/firmware.md) 0.22.0
- [uint8array-extras](https://npm.io/package/uint8array-extras.md) ^1.5.0
- [@mikrojs/analyze-imports](https://npm.io/package/@mikrojs/analyze-imports.md) 0.22.0
- [rxjs-exhaustmap-with-trailing](https://npm.io/package/rxjs-exhaustmap-with-trailing.md) ^2.1.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.22.0 (latest) — 2026-09-30
- 0.21.1-next.20260928214050 (next) — 2026-09-28
- 0.21.0-pr-431.20260921210123 (pr-431) — 2026-09-21
- 0.19.0-pr-352.20260829215534 (pr-352) — 2026-08-29
- 0.18.0-pr-306.20260731215718 (pr-306) — 2026-07-31
- 0.17.1-pr-300.20260731010039 (pr-300) — 2026-07-31
- 0.17.0-pr-276.20260721233726 (pr-276) — 2026-07-22
- 0.16.1-pr-265.20260718161156 (pr-265) — 2026-07-18
- 0.15.0-pr-243.20260613121220 (pr-243) — 2026-06-13
- 0.14.0-pr-229.20260613004639 (pr-229) — 2026-06-13
- 0.11.0-pr-172.g462f877 (pr-172) — 2026-05-30
- 0.10.0-pr-171.g56c9fcc (pr-171) — 2026-05-30
- 0.21.1-next.20260927212749 — 2026-09-27
- 0.21.1-next.20260926222438 — 2026-09-26
- 0.21.0 — 2026-09-21
- … 46 more at https://npm.io/package/mikro/versions

## README

<p align="center">
  <img src="https://mikrojs.dev/logo.svg" width="200" alt="Mikro.js logo">
</p>

<h1 align="center">Mikro.js</h1>

<p align="center">TypeScript-first runtime for microcontrollers with a focus on developer experience and iteration speed.</p>

<p align="center">
  <a href="https://mikrojs.dev">Documentation</a> · <a href="https://mikrojs.dev/getting-started">Getting Started</a> · <a href="https://mikrojs.dev/api/">API Reference</a> · <a href="https://mikrojs.dev/examples/">Examples</a>
</p>

<div align="center">

[![Open on npmx.dev](https://npmx.dev/api/registry/badge/name/mikro)](https://npmx.dev/package/mikro)
[![Open on npmx.dev](https://npmx.dev/api/registry/badge/version/mikro)](https://npmx.dev/package/mikro)
[![Open on npmx.dev](https://npmx.dev/api/registry/badge/updated/mikro)](https://npmx.dev/package/mikro)

</div>

> [!NOTE]
> Mikro.js is in early development. Expect APIs to change.

## Features

- **Fast feedback loop**: save a file and the device runs the new code seconds later
- **Full TypeScript**: near-complete ES2024, type-checked hardware APIs, editor autocomplete
- **Batteries included**: GPIO, PWM, I2C, SPI, UART, WiFi, HTTP, UDP, NeoPixel, deep sleep, SNTP, CBOR, schema validation, key-value storage
- **Host simulator**: run your code on your computer with `mikro sim dev`, no microcontroller attached
- **No exceptions**: typed `Result` errors instead of try/catch, so every expected failure is visible in the signature
- **Built-in testing**: test suites with resource leak detection, in the simulator or on real hardware

## Quickstart

```sh
npm create mikro
```

## Example

```ts
import {DigitalOut} from 'mikro/gpio'
import {sleep} from 'mikro/sleep'

const led = DigitalOut(20).orPanic('Failed to configure LED pin')

while (true) {
  led.write(1)
  await sleep(500)
  led.write(0)
  await sleep(500)
}
```

## Overview

The core runtime is a standalone C++ library with no ESP-IDF dependencies. This makes it portable across platforms.

- **Engine**: [QuickJS-NG](https://github.com/quickjs-ng/quickjs) ([near-complete ES2024 coverage](https://test262.fyi/#|qjs_ng))
- **Runtime**: Standalone C++ library with cooperative, single-threaded event loop
- **Platform**: ESP-IDF >= 6.1 (ESP32, ESP32-C3, ESP32-S3, ESP32-C5, ESP32-C6), desktop (macOS, Linux)
- **Modules**: Four-source resolution: virtual modules, native C modules, bytecode builtins, filesystem (LittleFS)
- **Bytecode**: TypeScript bundled with esbuild, compiled to QuickJS bytecode at build time
- **Tooling**: Node.js CLI (Ink/React), Node-API addon for host-side development and simulation

## Acknowledgements

Mikro.js has drawn heavy inspiration from [txiki.js](https://github.com/saghul/txiki.js), a small JavaScript runtime built on QuickJS.

Thanks to Felix Wieland ([@flexwie](https://github.com/flexwie)) for generously donating the `mikro` package name on npm.

## License

MIT

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