UNPKG

pi-motion-detection

Version:

A software based detection module for the Raspberry Pi camera

19 lines (14 loc) 396 B
'use strict'; const path = require('path'); const MotionDetectionModule = require('./index'); const motionDetector = new MotionDetectionModule({ captureDirectory: path.resolve(__dirname, 'captures'), captureVideoOnMotion: true, }); motionDetector.on('motion', () => { console.log('motion!'); }); motionDetector.on('error', (error) => { console.log(error); }); motionDetector.watch();