![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
streaming-cache
Advanced tools
Speed up your services.
Cache, queue and distribute streams immediately. Streams can be replayed immediately, even if the source is not finished.
Uses a fixed size LRU-cache in the background.
Usefull for caching (slow) streaming connections, such as S3 requests or complex database queries.
If there are for example 3 requests for a certain file in close succession, then we can pipe the result for the first request into the cache. The 2 other requests will receive a stream which will start even before the first one is finished.
Serving from this cache is extremely fast. On my local machine I get 2.5GB per second for a single process on localhost using AB. (4th gen i7).
npm i streaming-cache --save
var Cache = require('../index.js');
var cache = new Cache();
var fs = require('fs');
var readstream = fs.createReadStream('readme.md');
var writestream = fs.createWriteStream('test2.txt');
readstream.pipe(cache.set('a'));
setTimeout(function(){
writestream2.write('written from cache\n\n');
cache.get('a').pipe(writestream);
}, 200);
For a list of options see: https://www.npmjs.com/package/lru-cache
returns a Duplex stream
fileStream.pipe(cache.set('key')).pipe(res);
var cached = cache.get('key');
if(cached){
cached.pipe(res);
}
A set data synchronously to stream at a later moment
Get data with a callback.
cache.getData('key', function(err, data){
if(err){
//handle error
}
// do something with data
}));
Set metadata for a stream to be used later.
Get metadata
returns true or false if a key exists.
FAQs
Cache and replay NodeJS streams
The npm package streaming-cache receives a total of 50 weekly downloads. As such, streaming-cache popularity was classified as not popular.
We found that streaming-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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.