behinddeprecated

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

Usage no npm install needed!

<script type="module">
  import behind from 'https://cdn.skypack.dev/behind';
</script>

README

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