0.0.5 • Published 7 years ago

poller v0.0.5

Weekly downloads
279
License
MIT
Repository
github
Last release
7 years ago

Poller

NPM version Build Status Dependency Status devDependency Status Coverage Status Code Climate Codacy Badge

A FileSystem poller for Node.js

Summary

This was developed as a reliable alternative to using file watching libraries like Chokidar and Node Watch.

Install

npm install poller

Usage

// Require the library
const poller = require('poller');

// Poll a file directory
poller('/tmp/myFolder', (err, poll) => {

    // Log every time a file is added into the folder
    poll.on('add', (filePath) => {
        console.log(filePath,'was added');
    });

    // Log every time a file is removed from the folder
    poll.on('remove', (filePath) => {
        console.log(filePath,'was removed');
    });

    // Stop polling the folder for file adds/removals
    poll.close();

});

// Poll a file directory at an interval of 50ms (the default is 100ms)
poller('/tmp/myFolder', {interval: 50}, (err, poll) => {

});

Licence and Rights

© 2016 Anephenix Ltd. Poller is licenced under the MIT license. - See LICENSE for details.

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago