# pi-motion-detection

> A software based detection module for the Raspberry Pi camera

Latest version **1.1.3** (published 2017-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install pi-motion-detection
pnpm add pi-motion-detection
yarn add pi-motion-detection
bun add pi-motion-detection
```

## 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.1.3 |
| Published | 2017-07-18 |
| First published | 2017-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.11.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Stetson Pierce |
| Maintainers | stetsmando |
| Keywords | raspberry, pi, camera, module, motion, detection, software, pi-camera, raspistill, raspivid |

## Links

- npm: https://www.npmjs.com/package/pi-motion-detection
- Repository: https://github.com/stetsmando/pi-motion-detection
- Homepage: https://github.com/stetsmando/pi-motion-detection#readme
- Issues: https://github.com/stetsmando/pi-motion-detection/issues
- npm.io page: https://npm.io/package/pi-motion-detection

## Dependencies (3)

- [jimp](https://npm.io/package/jimp.md) ^0.2.28
- [config](https://npm.io/package/config.md) ^1.26.1
- [pi-camera](https://npm.io/package/pi-camera.md) ^1.0.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2017-07-18
- 1.1.2 — 2017-07-17
- 1.1.1 — 2017-07-17
- 1.1.0 — 2017-07-17
- 1.0.10 — 2017-07-17
- 1.0.1 — 2017-07-05
- 1.0.0 — 2017-07-05
- 0.1.3 — 2017-07-02
- 0.1.2 — 2017-07-02
- 0.1.1 — 2017-07-02
- 0.1.0 — 2017-07-02
- 0.0.5 — 2017-07-02
- 0.0.4 — 2017-07-02
- 0.0.3 — 2017-07-02
- 0.0.2 — 2017-07-02
- … 1 more at https://npm.io/package/pi-motion-detection/versions

## README

# pi-motion-detection
A software based detection module for the Raspberry Pi camera using the [Pi-Camera](https://www.npmjs.com/package/pi-camera) module.

## Wanna Contribute or Help Out?
Feel free to head over to the GitHub page for pi-motion-detection and submit comments, issues, pulls, and whatever else you'd like. I plan on adding features as I need them for my own projects so if something isn't happening fast enough for you why not fix it? (:

## Installation
```javascript
// NPM 5
npm install pi-motion-detection

// Older NPM versions
npm install pi-motion-detection --save
```

## Basic usage
```javascript
const path = require('path');
const MotionDetectionModule = require('pi-motion-detection');
const motionDetector = new MotionDetectionModule({
  captureDirectory: path.resolve(__dirname, 'captures'),
});

motionDetector.on('motion', () => {
  console.log('motion!');
});

motionDetector.on('error', (error) => {
  console.log(error);
});

motionDetector.watch();
```

## Constructor Options
```javascript
const motionDetector = new MotionDetectionModule({
  // Required
  captureDirectory: foo, // Directory to store tmp photos and video captures. Those will be written into
                         // captureDirectory/images and captureDirectory/videos respectively

  // Optional
  continueAfterMotion: false,  // Defaults to false
                               // Flag to control if motion detection will continue after detection
  
  captureVideoOnMotion: false, // Defaults to false
                               // Flag to control video capture on motion detection
});
```

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