metawatch
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

Deep nested directories watch for node.js

ci status snyk npm version npm downloads/month npm downloads license

  • Watch directories recursive
  • Rebuild recursive when new directories found or old directories remove
  • Deduplicate events with debounce

Usage

const metawatch = require('metawatch');

const watcher = new metawatch.DirectoryWatcher({ timeout: 200 });
watcher.watch('/home/marcus/Downloads');
watcher.watch('/home/marcus/Documents');

watcher.on('change', (fileName) => {
  console.log({ changed: fileName });
});

watcher.on('delete', (fileName) => {
  console.log({ deleted: fileName });
});

watcher.on('before', (changes) => {
  console.log({ changes });
});

watcher.on('after', (changes) => {
  console.log({ changes });
});

Contributors

License & Contributors

Copyright (c) 2020-2023 Metarhia contributors. Metawatch is MIT licensed. Metawatch is a part of Metarhia technology stack.

/metawatch/

    Package Sidebar

    Install

    npm i metawatch

    Homepage

    metarhia.com

    Weekly Downloads

    48

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    7.09 kB

    Total Files

    5

    Last publish

    Collaborators

    • timur.shemsedinov