1.0.11 • Published 7 months ago
camera-watch v1.0.11
camera-watch
A Node.js module that monitors webcam usage state on Linux and macOS systems.
Installation
npm install camera-watch
Usage
import { watch } from "camera-watch";
watch({
device: "video0", // optional, defaults to 'video0' on Linux; not required on macOS.
onChange: (state) => {
console.log("Camera state:", state);
},
onError: (error) => {
console.error("Error:", error);
},
});
Platform Support
- Linux: Monitors camera usage by watching device access using
lsof
- macOS: Monitors camera state by watching VDCAssistant power state logs
License
MIT