Skip to content
detects any changes in directory
CoffeeScript JavaScript
Find file
Pull request Compare This branch is even with master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin spy executable
.gitignore gitignore
README.md readme
package.json add minimatch patterns
spier.coffee pattern key added
spier.js pattern key added

README.md

Spier 1.1

Spies for any changes in directory, such as

  • create
  • remove
  • change
  • rename


Installation

$ npm install -g spier


Command line usage

$ spy --help


Command line usage example

$ spy -d . --ignore .idea\|.git --filter \/js\/\|\/less\/


Node.js usage

Spier = require('spier');

spier = new Spier('src');

ftype = function (file) {
    return file.stat.isDirectory() ? 'directory' : 'file';
};

spier.on( 'create', function (file) {
    console.log( 'create' + ' ' +  ftype(file) + ' ' + file.path );
});
spier.on( 'remove', function (file) {
    console.log( 'remove' + ' ' +  ftype(file) + ' ' + file.path );
});
spier.on( 'change', function (file) {
    console.log( 'change' + ' ' +  ftype(file) + ' ' + file.path );
});
spier.on( 'rename', function (from, to, file) {
    console.log( 'rename', ftype(file), from, to );
});

spier.spy();


Something went wrong with that request. Please try again.