
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
directory-cache
Advanced tools
A directory cache, built on top of DirectoryWatcher. The cache reads all the files in a directory and caches their content. When files are changed, added, deleted etc the cache will update and fire an event using the good old EventEmitter API.
npm install directory-cache
var DirectoryCache = require('directory-cache');
var cache = DirectoryCache.create({
directory: '/path/to/the/moon'
}/*, optionally supply a callback to automatically call .init */);
cache.on('add', function(files) {
var content = cache.getFileContent(files[0]);
// do something with content
});
cache.on('change', function(files) {
// etc...
});
cache.on('delete', function(files) {
// etc..
});
cache.on('error', function(err) {
// waaaaaaaaah!
})
cache.init(function(err) {
if (err)
return console.log('ahhhhhhhhhhhh!', err);
var content = cache.getFileContent('moo.txt'); // returns the content of /path/to/the/moon/moo.txt
var files = cache.getFiles(); // returns all the files in /path/to/the/moon
});
// regular expression retains only json files
var DirectoryCache = require('directory-cache');
var cache = DirectoryCache.create({
directory: '/path/to/the/moon',
filter: /.*json/
});
// function filter that retains only json files
var cache2 = DirectoryCache.create({
directory: '/path/to/the/moon',
filter: function(file) { return file.slice(-5).toLowerCase() === '.json' }
});
FAQs
A directory cache + watch util
The npm package directory-cache receives a total of 13 weekly downloads. As such, directory-cache popularity was classified as not popular.
We found that directory-cache 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.

Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.

Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.