appcd-fswatcher

2.0.7 • Public • Published

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.

/appcd-fswatcher/

    Package Sidebar

    Install

    npm i appcd-fswatcher

    Weekly Downloads

    8

    Version

    2.0.7

    License

    Apache-2.0

    Unpacked Size

    123 kB

    Total Files

    5

    Last publish

    Collaborators

    • cb1kenobi
    • awam
    • tisdk