0.0.14 • Published 8 years ago

inode-watch v0.0.14

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

FS Watch

A simple project that watch filesystem changes using inodes and paths.

var w = require('inode-watch');

w({every: 500})
  .on("start", console.log)
  .on("create", (op) => console.log("create", op))
  .on("move", (op) => console.log("move", op))
  .on("delete", (op) => console.log("delete", op))
  .on("change", (op) => console.log("change", op))
  .watch(__dirname)
;

The library scan the whole filesystem in order to create a map of current inodes used on the disk at a given path. Those inodes are used to understand the kind of event that is fired (create/update/move/delete)

  • create - a file is created
  • move - a file is moved
  • delete - a file is deleted
  • change - a file is changed

The library start watching the filesystem after the start event

Excludes

You can exclude different paths and files (or extensions) using regular expressions

w({every: 500, excludes: [/\.exe$/,/\.bat$/,/\.com$/]})
  .on("start", console.log)
  .on("create", (op) => console.log("create", op))
  .on("move", (op) => console.log("move", op))
  .on("delete", (op) => console.log("delete", op))
  .on("change", (op) => console.log("change", op))
  .watch(__dirname)
;

Why

Seems that all other projects looks for changes but not detect the move operation (that is often identified as: delete then create).

Notice

This project is actually a proof of concept about move identification and is under development and not stable at all.

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago