https://github.com/front-of-house/watch-dependency-graph
A small Node.js file watcher for watching dependency trees
https://github.com/front-of-house/watch-dependency-graph
Last synced: 4 months ago
JSON representation
A small Node.js file watcher for watching dependency trees
- Host: GitHub
- URL: https://github.com/front-of-house/watch-dependency-graph
- Owner: front-of-house
- Created: 2020-09-16T16:05:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-30T22:48:11.000Z (over 3 years ago)
- Last Synced: 2024-12-09T20:16:37.336Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.1 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# watch-dependency-graph
[](https://www.npmjs.com/package/watch-dependency-graph) [](https://coveralls.io/github/sure-thing/watch-dependency-graph?branch=main) [](https://packagephobia.com/result?p=watch-dependency-graph)
A small Node.js file watcher that watches dependency trees instead of globs or
directories.```js
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 absoluteconst removeListener = watcher.on('change', (files) => {})
removeListener()
```### License
MIT License © [Sure Thing](https://github.com/sure-thing)