# udev

> Bindings to libudev

Latest version **1.0.1** (published 2022-02-08) · BSD-2-Clause license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-02-08 |
| First published | 2013-08-17 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 3 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 36 |
| Author | Henri Tuhola |
| Maintainers | cheery |
| Keywords | udev, linux |

## Links

- npm: https://www.npmjs.com/package/udev
- Repository: https://github.com/cheery/node-udev
- Homepage: https://github.com/cheery/node-udev#readme
- Issues: https://github.com/cheery/node-udev/issues
- npm.io page: https://npm.io/package/udev

## Dependencies (3)

- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^4.0.0
- [@mapbox/node-pre-gyp](https://npm.io/package/@mapbox/node-pre-gyp.md) ^1.0.5

## Recent versions

- 1.0.1 (latest) — 2022-02-08
- 1.0.0 — 2021-07-31
- 0.6.0 — 2019-06-14
- 0.5.0 — 2019-01-05
- 0.4.0 — 2017-02-11
- 0.3.0 — 2016-05-14
- 0.2.0 — 2016-03-30
- 0.1.5 — 2016-01-21
- 0.1.3 — 2015-06-03
- 0.1.2 — 2015-05-29
- 0.1.1 — 2015-03-14
- 0.1.0 — 2013-08-17

## README

# node-udev - list devices in system and detect changes on them

This library attempts to follow the libudev where it makes sense. I only needed some usb input device detection so I was happy with quite few features.

Requires node-v10.0.0, nan and libudev.

## Installation

    npm install udev

### Installation on debian/ubuntu

    sudo apt-get install libudev-dev
    npm install udev

## How to Use

The example below lists devices and monitors udev events on the ipnut subsystem until receiving an add event. The code is separately listed in `samples/howto.js`.

    var udev = require("udev");

    console.log(udev.list()); // this is a long list :)

    var monitor = udev.monitor("input");
    monitor.on('add', function (device) {
        console.log('added ' + device);
        monitor.close() // this closes the monitor.
    });
    monitor.on('remove', function (device) {
        console.log('removed ' + device);
    });
    monitor.on('change', function (device) {
        console.log('changed ' + device);
    });
    
The example below lists devices belonging to subsystem "tty" i.e. various serial ports.

    var udev = require('udev');
    console.log(udev.list('tty'));

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