Skip to content

Development Guide ​

This section covers building Mikro.js firmware from source, writing drivers for sensors and peripherals, shipping C/C++ with a package as a native module, and describing development boards as board packages.

What you can contribute ​

  • Drivers: code for a sensor, display, motor controller or other peripheral. A driver is JavaScript on the core APIs, or a native module when it needs C or C++.
  • Native modules: C/C++ that a package ships, compiled into the firmware and imported by its package specifier.
  • Board packages: prebuilt firmware for a development board, and optionally the board's pin names and drivers wired to its pins.
  • Core runtime: Bug fixes, performance improvements, and new platform APIs in packages/@mikrojs/native/.

Prerequisites ​

  • Node.js >= 24
  • pnpm >= 10.30
  • direnv (loads the repo's .envrc, so the mikro CLI runs from source)
  • ESP-IDF prerequisites for your platform: see Espressif's setup guide
  • A USB cable and an ESP32 development board (for on-device testing)

Getting the source ​

sh
git clone --recurse-submodules https://github.com/mikrojs/mikro.git
cd mikro
pnpm install

If you already cloned without submodules:

sh
git submodule update --init --recursive
pnpm install

This installs all workspace dependencies and builds the qjsc bytecode compiler (used during firmware builds).

What's next ​

  • Custom Firmware: build and distribute custom firmware from npm packages
  • Building from Source: set up ESP-IDF and build firmware from the monorepo
  • Creating Drivers: write a driver for a peripheral in JavaScript
  • Native Modules: ship C/C++ with a package, compiled into the firmware
  • Creating Boards: define a board package with pin maps and sdkconfig
  • Architecture: how the build system, module registration, and bytecode pipeline work

Mikro.js is built with AI assistance, code and docs alike. Read the AI disclosure.