@ms-cloudpack/file-watcher
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@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

Name Type Description
path string The absolute base path to be watched.
watchedPaths string[] Relative paths from the base path to watch. Defaults to package.json and src/ folder.

Readme

Keywords

none

Package Sidebar

Install

npm i @ms-cloudpack/file-watcher

Weekly Downloads

207

Version

0.1.2

License

MIT

Unpacked Size

10.3 kB

Total Files

11

Last publish

Collaborators

  • ecraig12345_msft
  • uifabricteam
  • dzearing