Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
filestream-cache
Advanced tools
Cache stream content transparently.
Why is this preferred to storing content in 'memory'? Despite an 'in memory'
cache being very fast, the object must be stored as a Javascript String
which is subject to the memory manager of the runtime, it often doesn't make
sense to do memory management in our application when the operating system can
do a better job.
This method of caching defers the memory management to the operating system. The content is cached by writing to the filesystem transparently and then reading from it. Frequently used items are then naturally cached by the operating system's disk buffer cache.
get(identifier, options, createCallback)
purge(filter)
isStale(identifier)
writeThrough(identifier, stream)
var Cache = require('filestream-cache');
// Create the cache providing a location on the filesystem to store the cached
// objects
var cache = new Cache('/tmp/myappcache');
// Get a cached object by the cache key. If the object does not exist, create
// and cache it via the callback.
var stream = cache.get('cachekey', {}, function createStream() {
return generateMyCacheableStream();
});
stream.pipe(process.stdout);
MIT
FAQs
Cache stream content transparently.
We found that filestream-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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.