<commit_before># Node-inotify - monitoring file system events in Gnu/Linux with [NodeJS][nodejs_home]
The inotify API provides a mechanism for monitoring file system events.
Inotify can be used to monitor individual files, or to monitor directories.
When a directory is monitored, inotify will return events for the directory
itself, and for files inside the directory. [(ref: GNU/Linux Manual)][inotify.7]

## Installation
You must have [NodeJS][nodejs_dev] already installed to be able to build node-inotify.

    $ git clone git://github.com/c4milo/node-inotify.git
    $ cd node-inotify
    $ node-waf configure build

### Easy way
    $ npm install inotify

## API
  * `var inotify = new Inotify()`: Create a new instance of Inotify. By default it's in persistent mode.
  You can specify `false` in `var inotify = new Inotify(false)` to use the non persistent mode.

  * `var wd = inotify.addWatch(arg)`:  Add a watch for files or directories. This will then return a watch descriptor. The argument is an object as follows
        var arg = { path: 'path to be monitorized',
                    watch_for: an optional OR'ed set of events to watch for.
                               If they're not specified, it will use
                               Inotify.IN_ALL_EVENTS by default,
                    callback: Callback function that will receive each event.
        }
You can call this function as many times as you want to monitorize different paths.
**Inotify monitoring of directories is not recursive**: to monitor subdirectories
under a directory, additional watches must be created.<commit_msg>fixed typos<commit_after># Node-inotify - monitoring file system events in Gnu/Linux with [NodeJS][nodejs_home]
The inotify API provides a mechanism for monitoring file system events.
Inotify can be used to monitor individual files, or to monitor directories.
When a directory is monitored, inotify will return events for the directory
itself, and for files inside the directory. [(ref: GNU/Linux Manual)][inotify.7]

## Installation
You must have [NodeJS][nodejs_dev] already installed to be able to build node-inotify.

    $ git clone git://github.com/c4milo/node-inotify.git
    $ cd node-inotify
    $ node-waf configure build

### Easy way
    $ npm install inotify

## API
  * `var inotify = new Inotify()`: Create a new instance of Inotify. By default it's in persistent mode.
  You can specify `false` in `var inotify = new Inotify(false)` to use the non persistent mode.

  * `var wd = inotify.addWatch(arg)`:  Add a watch for files or directories. This will then return a watch descriptor. The argument is an object as follows
        var arg = { path: 'path to be monitored',
                    watch_for: an optional OR'ed set of events to watch for.
                               If they're not specified, it will use
                               Inotify.IN_ALL_EVENTS by default,
                    callback: Callback function that will receive each event.
        }
You can call this function as many times as you want to monitor different paths.
**Inotify monitoring of directories is not recursive**: to monitor subdirectories
under a directory, additional watches must be created.
{'fraction_non_alphanumeric': 0.06531881804043546, 'fraction_numerical': 0.001244167962674961, 'mean_word_length': 3.0503778337531484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4381339', 'n_tokens_mistral': 888, 'n_tokens_neox': 847, 'n_words': 410}