# node-raspberrypi-usbboot

> Transforms Raspberry Pi Compute Modules and Zeros to mass storage devices.

Latest version **1.1.12** (published 2026-07-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-raspberrypi-usbboot
pnpm add node-raspberrypi-usbboot
yarn add node-raspberrypi-usbboot
bun add node-raspberrypi-usbboot
```

## Health

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

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

Warnings: low downloads; no esm support; large bundle.

## Facts

| | |
|---|---|
| Version | 1.1.12 |
| Published | 2026-07-16 |
| First published | 2018-05-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 26.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5 |
| Author | Alexis Svinartchouk |
| Maintainers | balena.io |

## Links

- npm: https://www.npmjs.com/package/node-raspberrypi-usbboot
- Repository: https://github.com/balena-io-modules/node-raspberrypi-usbboot
- Homepage: https://github.com/balena-io-modules/node-raspberrypi-usbboot#readme
- Issues: https://github.com/balena-io-modules/node-raspberrypi-usbboot/issues
- npm.io page: https://npm.io/package/node-raspberrypi-usbboot

## Dependencies (2)

- [usb](https://npm.io/package/usb.md) ^2.12.1
- [debug](https://npm.io/package/debug.md) ^4.3.4

## Recent versions

- 1.1.12 (latest) — 2026-07-16
- 1.1.13-build-renovate-node-22-x-853b4e93d55f3f9a3a972ea97cffec930b8a8c67-1 (build-renovate-node-22-x) — 2026-09-12
- 1.1.12-build-renovate-node-20-19-x-92c7ce94d4c3fd2142d566a6d7d2ced23221453e-1 (build-renovate-node-20-19-x) — 2026-07-16
- 1.1.11-build-renovate-pin-dependencies-aa376c4527578cc6a2ded1e900302395658038aa-1 (build-renovate-pin-dependencies) — 2026-07-16
- 1.1.10-build-renovate-lock-file-maintenance-03f7f912229c87514f72709f99a3775cda54d3a0-1 (build-renovate-lock-file-maintenance) — 2026-06-08
- 1.1.6-build-renovate-rimraf-6-1-x-46e075c29e1f8b0190edce1ed3b07c70c07347bf-1 (build-renovate-rimraf-6-1-x) — 2026-05-16
- 1.1.6-build-renovate-major-24-node-b9e1b7fec5f31df29880a065aba9fb7096e50cc5-1 (build-renovate-major-24-node) — 2026-05-10
- 1.1.6-build-renovate-major-22-node-d91a12194e16bedb43a093e274ad1e1e19920306-1 (build-renovate-major-22-node) — 2026-05-10
- 1.1.6-build-renovate-major-9--balenalint-a16c363880db7cce5c24979179314d8d3520d9ff-1 (build-renovate-major-9--balenalint) — 2026-04-08
- 1.1.5-build-add-npm-oidc-permissions-8e7d49d0c19d99d5a7fbb34a2d284ebf62b3b513-1 (build-add-npm-oidc-permissions) — 2026-02-18
- 1.1.2-build-renovate-major-6-rimraf-7ff75fb675f7f12c754754ad6ea18d744e5ed35f-1 (build-renovate-major-6-rimraf) — 2025-03-19
- 1.1.1-build-renovate--balenalint-e9ca9b0e8292c50556320e5ef0c74511c9e236fe-1 (build-renovate--balenalint) — 2025-03-19
- 1.1.0-build-aethernet-allow-custom-sb-assets-5d1566668843688344ad0fb4ef40dbd5a108858b-1 (build-aethernet-allow-custom-sb-assets-5d1566668843688344ad0fb4ef40dbd5a108858b) — 2024-06-07
- 1.1.0-build-aethernet-allow-custom-sb-assets-1e632df4508ee97fcc25fa5ebdea8bf10a440aa9-1 (build-aethernet-allow-custom-sb-assets-1e632df4508ee97fcc25fa5ebdea8bf10a440aa9) — 2024-06-07
- 1.1.0-build-aethernet-allow-custom-sb-assets-bbd5392aa27ada26a0647cd0dc3308bd1a3eb330-1 (build-aethernet-allow-custom-sb-assets-bbd5392aa27ada26a0647cd0dc3308bd1a3eb330) — 2024-06-07
- … 156 more at https://npm.io/package/node-raspberrypi-usbboot/versions

## README

# node-rasbberrypi-usbboot

Transforms Raspberry Pi Compute Modules and Zeros to mass storage devices.

## Usage

For usage, see [the example](lib/main.ts).

On most GNU/Linux distributions, you'll need to run this as root.

Import `UsbbootScanner`, instanciate it, then on the instance attach the following event listeners:
 * `attach`: a device was connected and we started transforming it to a mass storage device;
 * `detach`: a device was detached, note that this could mean that it was physically detached or that it was successfully transformed into a mass storage device;
 * `error`: an error occured.

The `attach` and `detach` event listeners will get a `UsbbootDevice` as parameter. This object will emit `progress` events which parameter is the percentage of completion.
The progress will be `100` when the device reattaches itself as a mass storage device. This will be followed by a `detach` event from the `UsbbootScanner` (because the device
will no longer be a usbboot device).

## Details

This is heavily based on [Raspberry Pi USB booting code](https://github.com/raspberrypi/usbboot).

It should support Raspberry Pi Compute Modules and Raspberry Pi Zeros.

This module will upload a slightly more complex kernel to the pis than the original code above, it allows the devices
to reach higher write speeds at the cost of a longer preparation phase.

## Troubleshooting

If you have any trouble using this module, please check if it works with the original usb boot link above.

You can enable debug output by setting the `DEBUG` env var to `node-raspberrypi-usbboot`.

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