camera-watch
v1.0.11
Published
Monitor camera usage on macOS and Linux
Maintainers
Readme
camera-watch
A Node.js module that monitors webcam usage state on Linux and macOS systems.
Installation
npm install camera-watchUsage
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
