Giter Site home page Giter Site logo

node-inotifyr's Introduction

node-inotifyr

Because file watching is hard.

Build Status Dependency Status devDependency Status

Installation

$ npm install inotifyr

Usage

var Inotifyr = require('inotifyr');

var watcher = new Inotifyr('path/to/watch');
watcher.on('create', function (filename, stats) {
  console.log('Added %s: %s', stats.isDir ? 'dir' : 'file', filename);
});

API

Inotifyr(dir[, options])

Options

An object with the following properties

  • events: (String | Array) Default: ['create', 'modify', 'delete', 'move'] A list of the events below to watch for.
  • recursive: (Boolean) Default: false Should sub directories be watched?
  • onlydir: (Boolean) Default: false Only watch the path if it is a directory.
  • dont_follow: (Boolean) Default: false Do not follow symbolics links
  • oneshot: (Boolean) Default: false Only send events once

Available Events

  • access: File was accessed (read)
  • attrib: Metadata changed, e.g., permissions, timestamps, extended attributes, link count (since Linux 2.6.25), UID, GID, etc.
  • close_write: File opened for writing was closed
  • close_nowrite: File not opened for writing was closed
  • create: File/directory created in the watched directory
  • delete: File/directory deleted from the watched directory
  • delete_self: Watched file/directory was deleted
  • modify: File was modified
  • move_self: Watched file/directory was moved
  • move_from: File moved out of the watched directory
  • move_to: File moved into watched directory
  • open: File was opened
  • all: Watch for all kind of events
  • close: (close_write | close_nowrite) Close
  • move: (move_to | move_from) Moves

Development

Executing the tests

$ npm test

Running jshint

$ npm run hint

node-inotifyr's People

Contributors

dignifiedquire avatar

Watchers

Joel Moss avatar Max Kraev avatar  avatar James Cloos avatar Dmitrii Suchkov avatar  avatar Evgeny avatar Freddy May avatar Igor Yashtykov avatar Anna Glushkova avatar Pavel Shalagin avatar Konstantin avatar  avatar Andrey Nikitin avatar Vasiliy Levykin avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.