https://github.com/ember-cli/watch-detector
https://github.com/ember-cli/watch-detector
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ember-cli/watch-detector
- Owner: ember-cli
- License: mit
- Created: 2017-12-10T18:26:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-27T20:43:58.000Z (over 2 years ago)
- Last Synced: 2025-06-12T12:05:01.348Z (8 months ago)
- Language: JavaScript
- Size: 1.09 MB
- Stars: 0
- Watchers: 7
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# watch-detector
[](https://travis-ci.org/chrmod/watch-detector)
Utility for selecting the best options for `sane`:
watcher options:
* `watchman`: if a valid version of watchman is installed, we will prefer this.
* `node`: use node's built in watcher, if watchman is not present.
future options:
* `fs-events`: https://github.com/chrmod/watch-detector/issues/6
## usage
```sh
yarn add watch-detector
```
```js
const WatchDetector = require('watch-detector');
const sane = require('sane');
let detector = new WatchDetector();
let saneOptions = {
/* sane options */
};
let options = detector.findBestWatcherOption(saneOptions)
/* options's watcher selection will be based on various heuristics */
sane(root, options);
```
## optional
```js
new WatchDetector({
ui: /* console-ui instance */,
fs: /* fs instance */
});
```