appcd-fswatcher

A filesystem watcher that actually works.

Usage no npm install needed!

<script type="module">
  import appcdFswatcher from 'https://cdn.skypack.dev/appcd-fswatcher';
</script>

README

appcd-fswatcher

A filesystem watcher that actually works.

Visit https://github.com/appcelerator/appc-daemon for more information.

Report issues to GitHub issues. Official issue tracker in JIRA.

Installation

npm i appcd-fswatcher

Usage

import FSWatcher from 'appcd-fswatcher';

const watcher = new FSWatcher('/path/to/watch', {
    recursive: true,
    depth: 2
});

watcher.on('change', evt => {
    console.log(evt);
});

watcher.on('error', err => {
    console.error(err);
});

To stop watching, you can call close():

watcher.close();

Extra functions:

import {
    renderTree,
    status
} from 'appcd-fswatcher';

// display an ascii tree of the filesystem tree that's being watched
console.log(renderTree());

// display filesystem watcher stats (as well as the tree)
console.log(status());

Legal

This project is open source under the Apache Public License v2 and is developed by Axway, Inc and the community. Please read the LICENSE file included in this distribution for more information.