
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
Simple comparison of attributes of two files.
npm install fs-compare
var fsCompare = require('fs-compare');
var modifiedTime = function (fileName, cb) {
fs.stat(fileName, function (err, stat) {
if (err) {
return cb(err);
}
return cb(null, stat.mtime);
});
};
fsCompare(modifiedTime, 'foo.txt', 'bar.txt', function (err, diff) {
// diff is -1 if foo.txt was created before bar.txt
// diff is 0 if foo.txt was created at the same time as bar.txt
// diff is 1 if foo.txt was created after bar.txt
});
Stat helpers are included, so you can shortcut the above with:
var fsCompare = require('fs-compare');
fsCompare.ctime('foo.txt', 'bar.txt', function (err, diff) {
// diff is -1 if foo.txt was created before bar.txt
// diff is 0 if foo.txt was created at the same time as bar.txt
// diff is 1 if foo.txt was created after bar.txt
});
var fsCompareSync = require('fs-compare').sync;
var modifiedTime = function (fileName, cb) {
return fs.statSync(fileName).mtime;
};
var diff = fsCompareSync(modifiedTime, 'foo.txt', 'bar.txt');
// diff is -1 if foo.txt was created before bar.txt
// diff is 0 if foo.txt was created at the same time as bar.txt
// diff is 1 if foo.txt was created after bar.txt
Stat helpers are included, so you can shortcut the above with:
var fsCompareSync = require('fs-compare').sync;
var diff = fsCompareSync.mtime(modifiedTime, 'foo.txt', 'bar.txt');
// diff is -1 if foo.txt was created before bar.txt
// diff is 0 if foo.txt was created at the same time as bar.txt
// diff is 1 if foo.txt was created after bar.txt
testFunction - Function with parameters (fileName, cb) which tests the
file and returns the value to be compared on the callback.fileNameA, fileNameB - Filenames of files to be tested.callback - Callback to accept (error, diff), where diff is:
Compares the modified timestamp of the files.
Compares the created timestamp of the files.
Compares the access timestamp of the files.
Compares the size of the files.
Synchronous version of fsCompare.
Synchronous version of fsCompare.mtime.
Synchronous version of fsCompare.ctime.
Synchronous version of fsCompare.atime.
Synchronous version of fsCompare.size.
FAQs
Compare file stats of two files.
We found that fs-compare demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.