# fivdi/onoff

GPIO access and interrupt detection with Node.js

Repository: https://github.com/fivdi/onoff
Canonical: https://ross.abutalabs.com/products/onoff
Language: JavaScript
License: MIT
License Family: permissive
Topics: gpio, interrupt, raspberry-pi, beaglebone, beaglebone-black, linux, javascript, nodejs, iot
Last push: 2024-06-27T02:45:26+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5061, "days_push": 797, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1259, forks 124 (observed 2026-08-28T04:04:09.725766+00:00)

## What it is
onoff is a Node.js library providing GPIO access and interrupt detection on Linux single-board computers like the Raspberry Pi and BeagleBone. It offers synchronous, callback, and promise-based APIs for reading and writing GPIO pins and watching for edge-triggered interrupts.

## Use cases
- blink an LED from a Node.js script on a Raspberry Pi
- read button presses with interrupt detection in Node.js
- debounce physical buttons connected to GPIO pins
- control hardware outputs on a BeagleBone Black with JavaScript
- build IoT prototypes using Node.js on Linux boards
- configure pullup and pulldown resistors for GPIO inputs

## When to choose
- you need GPIO control from Node.js on a Linux SBC like Raspberry Pi or BeagleBone
- you want interrupt-driven input handling with edge detection
- you prefer a simple, well-documented npm package with sync, callback, and promise APIs

## When to avoid
- you are on a non-Linux platform such as Windows or macOS
- you need high-performance or real-time GPIO timing
- you are working with newer Node.js versions beyond those the library supports
- you need support for other interfaces like I2C, SPI, or PWM

## Facets
- artifact type: library
- maturity: maintenance
- function: iot, embedded
- domain: iot, embedded-systems, hardware
- platform: iot
- tags: gpio, interrupts, raspberry-pi, beaglebone, hardware-interfacing, embedded-linux, linux, nodejs

## Member repositories
- fivdi/onoff (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:09.725766+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:05:29.703949+00:00, confidence not recorded.
  - readme: https://github.com/fivdi/onoff (fetched 2026-08-28T04:04:09.725766+00:00, sha ccb7e733b970)
  - registry_npm: https://registry.npmjs.org/onoff (fetched 2026-08-29T12:16:57.765011+00:00, sha d0fb373b3aef)
- Data as of 2026-08-30T08:39:29.467469+00:00.
