Skip to content

Instantly share code, notes, and snippets.

@tb
Last active September 27, 2015 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tb/73dafb93c9e49085c0a3 to your computer and use it in GitHub Desktop.
Save tb/73dafb93c9e49085c0a3 to your computer and use it in GitHub Desktop.
mtimediff.js
#!/usr/bin/env node
var fs = require('fs');
if (process.argv.length <= 3) {
console.log("Usage: " + __filename + " file1 file2");
process.exit(-1);
}
var file1 = process.argv[2];
var file2 = process.argv[3];
fs.stat(file1, function(err, stat1) {
fs.stat(file2, function(err, stat2) {
console.log(stat1.mtime - stat2.mtime);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment