New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ms-cloudpack/file-watcher

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ms-cloudpack/file-watcher

A file watcher abstraction for use with Cloudpack.

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
460
increased by31.05%
Maintainers
3
Weekly downloads
 
Created
Source

@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.dispose to unsubscribe from all watchers.
// Dispose an individual watcher.
await unwatch();

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

createWatcher options

  • type ('default' | 'fork', optional): By default, this will create a watcher in the same thread. Use type: 'fork' to create the watcher in a forked process.

watcher.watch options

  • path (string): The absolute root path to be watched.
  • id (string, optional): ID for the watch job (defaults to path). If you call watch twice using the same id, subsequent calls will be ignored.
  • watchedPaths (string[], optional): Relative paths/globs from the root path to watch. Defaults to *.json and src/**/*, excluding node_modules.

FAQs

Package last updated on 22 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc