chokidar.watch(VIDEO_DIRECTORY).on('all', (event, path) => {
if (event === 'unlink' && videoPartRegex.test(path)) {
debug(`unlink ${path}`)
// a video .mp4.part file was just unlinked which suggests that the video recording just finished.
doProcessVideo(path);
}
});
It would be nice if I could do this
instead of