behind

Figure out if a file is behind its dependencies a la make

npm install behind
2 downloads in the last week
8 downloads in the last month

Behind

Does mtime checking of a dependent file vs a bunch of dependencies. Basically the same thing a make task does before running.

Example


var behind = require('behind');

behind('./dependent.out', [ './dependency.in' ], function (err, deps) {
  if (err) throw err;

  //
  // If there are no deps, `deps` is null.
  // I'm open to changing this API.
  //
  if (deps) {
    console.log('stale dependencies:', deps);
  }
});

Alternately:


var behind = require('behind').sync;

var deps = behind('./dependent.out', [ './dependency.in' ]);

if (deps) {
  console.log('stale dependencies:', deps);
}

That's pretty much it.

License

MIT

npm loves you