watch-dependency-graph

[![npm version](https://img.shields.io/npm/v/watch-dependency-graph?style=flat&colorA=4488FF&colorB=4488FF)](https://www.npmjs.com/package/watch-dependency-graph) [![test coverage](https://img.shields.io/coveralls/github/sure-thing/watch-dependency-graph?


Keywords
dependency tree, module, graph, tree, node
License
MIT
Install
npm install watch-dependency-graph@1.0.0

Documentation

watch-dependency-graph

npm version test coverage npm bundle size

A small Node.js file watcher that watches dependency trees instead of globs or directories.

import { create } from 'watch-dependency-graph'

const files = [path.resolve(__dirname, './my-file.js')]

const watcher = create()

watcher.on('change', (files) => {}) // string[]
watcher.on('remove', (files) => {}) // string[]
watcher.on('error', (error) => {}) // string[]

watcher.add(files) // string or string[], must be absolute
watcher.remove(files) // string or string[], must be absolute

const removeListener = watcher.on('change', (files) => {})
removeListener()

License

MIT License © Sure Thing