项目作者: aleclarson

项目描述 :
Extensible watcher daemon
高级语言: JavaScript
项目地址: git://github.com/aleclarson/wchd.git
创建时间: 2018-07-01T20:34:10Z
项目社区:https://github.com/aleclarson/wchd

开源协议:MIT License

下载


wchd v0.10.3

Extensible watcher daemon (powered by fb-watchman)

A single, resilient connection shared between all packages via the wch client.

  1. const wch = require('wchd');
  2. // create a server
  3. const server = wch(opts);
  4. // watcher methods
  5. wch.connect();
  6. wch.watch(root, opts);
  7. wch.unwatch(root);
  8. wch.stream(dir, query);
  9. wch.query(dir, query);
  10. wch.list();

CLI

  • wch start start the daemon
  • wch stop stop the daemon

Watching

  • wch . watch current directory
  • wch -u . unwatch current directory
  • wch ./foo watch a relative directory
  • wch -u ./foo unwatch a relative directory
  • wch . -f watch current directory temporarily

The foreground (-f) watcher is lighter weight, because it only loads plugins that the current directory needs (instead of every plugin that every watched directory needs), and the API server isn’t started.