watch-dependency-graph
A Node file watcher, but instead of scanning the filesystem for files to be
watched, it monitors only specified entry files and their dependency trees.
const path = require('path')
const watch = require('watch-dependency-graph')
const files = [path.resolve(__dirname, './my-file.js')]
const watcher = watch({ cwd: __dirname })
watcher.on('change', files => {})
watcher.on('remove', files => {})
watcher.on('error', files => {})
watcher.add(files)
watcher.remove(files)
const removeListener = watcher.on('change', files => {})
removeListener()
License
MIT License © Sure Thing