A Node.js library that transforms Raspberry Pi Compute Modules and Zeros into mass storage devices via USB boot. Current stable version is 1.1.9. It is based on Raspberry Pi's official usbboot code but uses a more complex kernel for higher write speeds during the preparation phase. The library is TypeScript-native with bundled type definitions and uses an event-driven API (UsbbootScanner with attach/detach/error events). It requires root/sudo on most Linux distributions and only supports Linux. Alternative implementations include the official Raspberry Pi USB boot tool (C-based) and other platform-specific tools.
npm install node-raspberrypi-usbbootNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows event-driven setup of UsbbootScanner: attach, progress, detach, and error events. Must be run as root on Linux.
Run your Node.js script with sudo: sudo node yourscript.js
Use import syntax or set type: module in package.json
Check device's progress or use additional logic to differentiate disconnection from conversion completion.
Migrate to event listeners (attach, detach, error) as shown in quickstart.
Use a Linux environment (physical, VM, or WSL2 with USB passthrough).
Run the script with sudo: sudo node yourscript.js
Use dynamic import: await import('node-raspberrypi-usbboot'); or set type: module in package.json and use static import.Instantiate with new: const scanner = new UsbbootScanner();
Ensure the device is connected and in BOOT mode (hold BOOTSEL button while connecting), and that you run as root.