0.1.2 • Published 2 years ago

@ms-cloudpack/file-watcher v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@ms-cloudpack/file-watcher

An abstraction on the file watching capabilities used in Cloudpack.

Example usage

  1. Create a watcher:
const watcher = createWatcher();
  1. Subscribe to a particular package path using watch. (Returns an unwatch function.)
const unwatch = watcher.watch({ path: 'path/to/package' }, () => console.log(`package changed`));
  1. To dispose, call the returned unwatch, or call watcher.unwatchAll to unsubscribe from all watchers.
// Dispose an individual watcher.
await unwatch();

// Dispose all watchers.
await watcher.unwatchAll();

watcher.watch options

NameTypeDescription
pathstringThe absolute base path to be watched.
watchedPathsstring[]Relative paths from the base path to watch. Defaults to package.json and src/ folder.
0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago