# device-monitor

> Function | Description ---|--- ```startMonitoring()``` | Begins monitoring for changes in system ```stopMonitoring()``` | Ends monitoring for changes in system ```on('data', callback)``` | At the moment of connecting or disconnecting device returns in

Latest version **1.0.0** (published 2019-04-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install device-monitor
pnpm add device-monitor
yarn add device-monitor
bun add device-monitor
```

## 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.0 |
| Published | 2019-04-03 |
| First published | 2019-04-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | kamil062 |

## Links

- npm: https://www.npmjs.com/package/device-monitor
- npm.io page: https://npm.io/package/device-monitor

## Dependencies (1)

- [systeminformation](https://npm.io/package/systeminformation.md) ^4.1.4

## Recent versions

- 1.0.0 (latest) — 2019-04-03

## README

# device-monitor

### Module for monitoring of connecting and disconnecting devices in system

# Documentation:

Function | Description
---|---
```startMonitoring()``` | Begins monitoring for changes in system
```stopMonitoring()``` | Ends monitoring for changes in system
```on('data', callback)``` | At the moment of connecting or disconnecting device returns informations about that device: <br><br> `state` - state of a device (`connected` or `disconnected`) <br> `devices` - an array of connected or disconnected devices (eg. `[ 'E:', 'D:' ]`)

# Example:

```javascript
const deviceMonitor = require('../device-monitor')

deviceMonitor.startMonitoring();

deviceMonitor.on('data', (data) => {
    console.log(data.state);
    console.log(data.devices);
});

setTimeout(() => {
    deviceMonitor.stopMonitoring();
}, 10000);
```

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