{"_id":"fs-compare","_rev":"12-613fa1bf4eddc5408f1acd8ad6728e83","name":"fs-compare","description":"Compare file stats of two files.","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.0":{"name":"fs-compare","version":"0.0.0","description":"Compare file stats of two files.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -R spec"},"repository":{"type":"git","url":"git://github.com/jdeal/fscompare.git"},"keywords":["compare","files","stat"],"author":{"name":"Justin Deal"},"license":"MIT","devDependencies":{"mocha":"~1.10.0"},"dependencies":{"chai":"~1.6.0"},"readme":"# fs-compare\n\nCompares attributes of two files.\n\n\n","_id":"fs-compare@0.0.0","dist":{"shasum":"756d3a134d3ab85c1dd7bf21c1bb7aef00e7752f","tarball":"https://registry.npmjs.org/fs-compare/-/fs-compare-0.0.0.tgz","integrity":"sha512-Z7lLSZKWZ6f7xIhqIgrRItztF0hwVqeG1oZNerqbJQRq/npqNOFhk5Egz14P9TQlq3bBxUjrgrYYLdedPxT+Qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADXdLJf1l3CBFQ4l7+UCACQqMki5UWMm5316E0T+WMUAiAtJY0xQlnmHhnuyt8ykaJGxKSIPIwTbELlYoRuGsia4Q=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.0.2":{"name":"fs-compare","version":"0.0.2","description":"Compare file stats of two files.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -R spec"},"repository":{"type":"git","url":"git://github.com/jdeal/fscompare.git"},"keywords":["compare","files","stat"],"author":{"name":"Justin Deal"},"license":"MIT","devDependencies":{"mocha":"~1.10.0"},"dependencies":{"chai":"~1.6.0"},"readme":"# fs-compare\n\n[![Build Status](https://secure.travis-ci.org/jdeal/fs-compare.png)](http://travis-ci.org/jdeal/fs-compare)\n\nSimple comparison of attributes of two files.\n\n# Installation\n\n```bash\nnpm install fs-compare\n```\n\n# Usage\n\n## Asynchronous\n\n```js\nvar fsCompare = require('fs-compare');\n\nvar modifiedTime = function (fileName, cb) {\n  fs.stat(fileName, function (err, stat) {\n    if (err) {\n      return cb(err);\n    }\n    return cb(null, stat.mtime);\n  });\n};\n\nfsCompare(modifiedTime, 'foo.txt', 'bar.txt', function (err, diff) {\n  // diff is -1 if foo.txt was created before bar.txt\n  // diff is 0 if foo.txt was created at the same time as bar.txt\n  // diff is 1 if foo.txt was created after bar.txt\n});\n```\n\nStat helpers are included, so you can shortcut the above with:\n\n```js\nvar fsCompare = require('fs-compare');\n\nfsCompare.ctime('foo.txt', 'bar.txt', function (err, diff) {\n  // diff is -1 if foo.txt was created before bar.txt\n  // diff is 0 if foo.txt was created at the same time as bar.txt\n  // diff is 1 if foo.txt was created after bar.txt\n});\n```\n\n## Synchronous\n\n```js\nvar fsCompareSync = require('fs-compare').sync;\n\nvar modifiedTime = function (fileName, cb) {\n  return fs.statSync(fileName).mtime;\n};\n\nvar diff = fsCompareSync(modifiedTime, 'foo.txt', 'bar.txt');\n\n// diff is -1 if foo.txt was created before bar.txt\n// diff is 0 if foo.txt was created at the same time as bar.txt\n// diff is 1 if foo.txt was created after bar.txt\n```\n\nStat helpers are included, so you can shortcut the above with:\n\n```js\nvar fsCompareSync = require('fs-compare').sync;\n\nvar diff = fsCompareSync.mtime(modifiedTime, 'foo.txt', 'bar.txt');\n\n// diff is -1 if foo.txt was created before bar.txt\n// diff is 0 if foo.txt was created at the same time as bar.txt\n// diff is 1 if foo.txt was created after bar.txt\n```\n\n# API\n\n## fsCompare(testFunction, fileNameA, fileNameB, callback)\n\n- `testFunction` - Function with parameters `(fileName, cb)` which tests the\nfile and returns the value to be compared on the callback.\n- `fileNameA`, `fileNameB` - Filenames of files to be tested.\n- `callback` - Callback to accept `(error, diff)`, where `diff` is:\n    - -1 - file A tests less than file B\n    - 0 - file A tests equal to file B\n    - 1 - file A tests greater than file B\n\n## fsCompare.mtime(fileNameA, fileNameB, callback)\n\nCompares the modified timestamp of the files.\n\n## fsCompare.ctime(fileNameA, fileNameB, callback)\n\nCompares the created timestamp of the files.\n\n## fsCompare.atime(fileNameA, fileNameB, callback)\n\nCompares the access timestamp of the files.\n\n## fsCompare.size(fileNameA, fileNameB, callback)\n\nCompares the size of the files.\n\n## fsCompareSync(testFunction, fileNameA, fileNameB)\n\nSynchronous version of `fsCompare`.\n\n## fsCompareSync.mtime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.mtime`.\n\n## fsCompareSync.ctime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.ctime`.\n\n## fsCompareSync.atime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.atime`.\n\n## fsCompareSync.size(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.size`.","_id":"fs-compare@0.0.2","dist":{"shasum":"9c0dda23c9475c910d69963b69e77f1d298c28e2","tarball":"https://registry.npmjs.org/fs-compare/-/fs-compare-0.0.2.tgz","integrity":"sha512-HBvYc29ru9MQW+FqkLTlklr4DNpLdaIx6cvN+tF0/llqSnyG43IfBcGc/bRdXMLO69JRozJuWj2AEK9dj8kF7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQiYATHPPNsxpUyCz5v+rFLu9O9Rp1Irv3K7hPW0GlWgIhAPzRQseh5Zyrk4ugxBW38tyiZHnuLfLU0tsfz8jQpvej"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.0.3":{"name":"fs-compare","version":"0.0.3","description":"Compare file stats of two files.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -R spec"},"repository":{"type":"git","url":"git://github.com/jdeal/fscompare.git"},"keywords":["compare","files","stat"],"author":{"name":"Justin Deal"},"license":"MIT","devDependencies":{"mocha":"~1.10.0","chai":"~1.6.0"},"readme":"# fs-compare\n\n[![Build Status](https://secure.travis-ci.org/jdeal/fs-compare.png)](http://travis-ci.org/jdeal/fs-compare)\n\nSimple comparison of attributes of two files.\n\n# Installation\n\n```bash\nnpm install fs-compare\n```\n\n# Usage\n\n## Asynchronous\n\n```js\nvar fsCompare = require('fs-compare');\n\nvar modifiedTime = function (fileName, cb) {\n  fs.stat(fileName, function (err, stat) {\n    if (err) {\n      return cb(err);\n    }\n    return cb(null, stat.mtime);\n  });\n};\n\nfsCompare(modifiedTime, 'foo.txt', 'bar.txt', function (err, diff) {\n  // diff is -1 if foo.txt was created before bar.txt\n  // diff is 0 if foo.txt was created at the same time as bar.txt\n  // diff is 1 if foo.txt was created after bar.txt\n});\n```\n\nStat helpers are included, so you can shortcut the above with:\n\n```js\nvar fsCompare = require('fs-compare');\n\nfsCompare.ctime('foo.txt', 'bar.txt', function (err, diff) {\n  // diff is -1 if foo.txt was created before bar.txt\n  // diff is 0 if foo.txt was created at the same time as bar.txt\n  // diff is 1 if foo.txt was created after bar.txt\n});\n```\n\n## Synchronous\n\n```js\nvar fsCompareSync = require('fs-compare').sync;\n\nvar modifiedTime = function (fileName, cb) {\n  return fs.statSync(fileName).mtime;\n};\n\nvar diff = fsCompareSync(modifiedTime, 'foo.txt', 'bar.txt');\n\n// diff is -1 if foo.txt was created before bar.txt\n// diff is 0 if foo.txt was created at the same time as bar.txt\n// diff is 1 if foo.txt was created after bar.txt\n```\n\nStat helpers are included, so you can shortcut the above with:\n\n```js\nvar fsCompareSync = require('fs-compare').sync;\n\nvar diff = fsCompareSync.mtime(modifiedTime, 'foo.txt', 'bar.txt');\n\n// diff is -1 if foo.txt was created before bar.txt\n// diff is 0 if foo.txt was created at the same time as bar.txt\n// diff is 1 if foo.txt was created after bar.txt\n```\n\n# API\n\n## fsCompare(testFunction, fileNameA, fileNameB, callback)\n\n- `testFunction` - Function with parameters `(fileName, cb)` which tests the\nfile and returns the value to be compared on the callback.\n- `fileNameA`, `fileNameB` - Filenames of files to be tested.\n- `callback` - Callback to accept `(error, diff)`, where `diff` is:\n    - -1 - file A tests less than file B\n    - 0 - file A tests equal to file B\n    - 1 - file A tests greater than file B\n\n## fsCompare.mtime(fileNameA, fileNameB, callback)\n\nCompares the modified timestamp of the files.\n\n## fsCompare.ctime(fileNameA, fileNameB, callback)\n\nCompares the created timestamp of the files.\n\n## fsCompare.atime(fileNameA, fileNameB, callback)\n\nCompares the access timestamp of the files.\n\n## fsCompare.size(fileNameA, fileNameB, callback)\n\nCompares the size of the files.\n\n## fsCompareSync(testFunction, fileNameA, fileNameB)\n\nSynchronous version of `fsCompare`.\n\n## fsCompareSync.mtime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.mtime`.\n\n## fsCompareSync.ctime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.ctime`.\n\n## fsCompareSync.atime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.atime`.\n\n## fsCompareSync.size(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.size`.","_id":"fs-compare@0.0.3","dist":{"shasum":"ec432700cbf6d6ebd5eeab55d82d33f208424fd7","tarball":"https://registry.npmjs.org/fs-compare/-/fs-compare-0.0.3.tgz","integrity":"sha512-FOvIkw7hKBOUV5FftH2dcTpHrhU4ev11Ri8PGu/hO9Cp9b3b1dgNb8yLZx4oQzpfKTXRUsZ3lQtbSw5UJ2qMHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrh32EDhuTpRTddwTpHlKOZuZtcTODzFTFDu2iGNxpRAIhAMintk9HkdaGZTAXKoW4kIqj6XLOuF5H/reuuOKo7F2z"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.0.4":{"name":"fs-compare","version":"0.0.4","description":"Compare file stats of two files.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -R spec"},"repository":{"type":"git","url":"git://github.com/jdeal/fs-compare.git"},"keywords":["compare","files","stat"],"author":{"name":"Justin Deal"},"license":"MIT","devDependencies":{"mocha":"~1.10.0","chai":"~1.6.0"},"readme":"# fs-compare\n\n[![Build Status](https://secure.travis-ci.org/jdeal/fs-compare.png)](http://travis-ci.org/jdeal/fs-compare)\n\nSimple comparison of attributes of two files.\n\n# Installation\n\n```bash\nnpm install fs-compare\n```\n\n# Usage\n\n## Asynchronous\n\n```js\nvar fsCompare = require('fs-compare');\n\nvar modifiedTime = function (fileName, cb) {\n  fs.stat(fileName, function (err, stat) {\n    if (err) {\n      return cb(err);\n    }\n    return cb(null, stat.mtime);\n  });\n};\n\nfsCompare(modifiedTime, 'foo.txt', 'bar.txt', function (err, diff) {\n  // diff is -1 if foo.txt was created before bar.txt\n  // diff is 0 if foo.txt was created at the same time as bar.txt\n  // diff is 1 if foo.txt was created after bar.txt\n});\n```\n\nStat helpers are included, so you can shortcut the above with:\n\n```js\nvar fsCompare = require('fs-compare');\n\nfsCompare.ctime('foo.txt', 'bar.txt', function (err, diff) {\n  // diff is -1 if foo.txt was created before bar.txt\n  // diff is 0 if foo.txt was created at the same time as bar.txt\n  // diff is 1 if foo.txt was created after bar.txt\n});\n```\n\n## Synchronous\n\n```js\nvar fsCompareSync = require('fs-compare').sync;\n\nvar modifiedTime = function (fileName, cb) {\n  return fs.statSync(fileName).mtime;\n};\n\nvar diff = fsCompareSync(modifiedTime, 'foo.txt', 'bar.txt');\n\n// diff is -1 if foo.txt was created before bar.txt\n// diff is 0 if foo.txt was created at the same time as bar.txt\n// diff is 1 if foo.txt was created after bar.txt\n```\n\nStat helpers are included, so you can shortcut the above with:\n\n```js\nvar fsCompareSync = require('fs-compare').sync;\n\nvar diff = fsCompareSync.mtime(modifiedTime, 'foo.txt', 'bar.txt');\n\n// diff is -1 if foo.txt was created before bar.txt\n// diff is 0 if foo.txt was created at the same time as bar.txt\n// diff is 1 if foo.txt was created after bar.txt\n```\n\n# API\n\n## fsCompare(testFunction, fileNameA, fileNameB, callback)\n\n- `testFunction` - Function with parameters `(fileName, cb)` which tests the\nfile and returns the value to be compared on the callback.\n- `fileNameA`, `fileNameB` - Filenames of files to be tested.\n- `callback` - Callback to accept `(error, diff)`, where `diff` is:\n    - -1 - file A tests less than file B\n    - 0 - file A tests equal to file B\n    - 1 - file A tests greater than file B\n\n## fsCompare.mtime(fileNameA, fileNameB, callback)\n\nCompares the modified timestamp of the files.\n\n## fsCompare.ctime(fileNameA, fileNameB, callback)\n\nCompares the created timestamp of the files.\n\n## fsCompare.atime(fileNameA, fileNameB, callback)\n\nCompares the access timestamp of the files.\n\n## fsCompare.size(fileNameA, fileNameB, callback)\n\nCompares the size of the files.\n\n## fsCompareSync(testFunction, fileNameA, fileNameB)\n\nSynchronous version of `fsCompare`.\n\n## fsCompareSync.mtime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.mtime`.\n\n## fsCompareSync.ctime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.ctime`.\n\n## fsCompareSync.atime(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.atime`.\n\n## fsCompareSync.size(fileNameA, fileNameB, callback)\n\nSynchronous version of `fsCompare.size`.","_id":"fs-compare@0.0.4","dist":{"shasum":"17076f91b863c6a0d539220e73c0d88c46523e7a","tarball":"https://registry.npmjs.org/fs-compare/-/fs-compare-0.0.4.tgz","integrity":"sha512-55FHXno4PmS+2KFQn6SGf3y7KtpDz9woO+HAhecW7sOkyfvwbAgE6UUEy9Zk4I94VZeTuqn+syqB1wQPXh2JQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRE16yATI3FnVDaS8ojYXNQRWg7nKtA9bw9S9VBCNBNwIgZmN17NKC20zFGYsiTcgFkWHmdQSxxrqJ3rs6nNqTcP8="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]}},"readme":"# fs-compare\n\nCompares attributes of two files.\n\n\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"time":{"modified":"2022-06-18T03:51:49.584Z","created":"2013-05-27T21:41:14.789Z","0.0.0":"2013-05-27T21:41:15.340Z","0.0.2":"2013-06-08T21:51:40.256Z","0.0.3":"2013-06-08T21:54:18.483Z","0.0.4":"2013-06-08T21:59:26.870Z"},"author":{"name":"Justin Deal"},"repository":{"type":"git","url":"git://github.com/jdeal/fs-compare.git"},"users":{"gsalgadotoledo":true}}