Gathering detailed insights and metrics for keyv-lru-files
Gathering detailed insights and metrics for keyv-lru-files
npm install keyv-lru-files
Typescript
Module System
Node Version
NPM Version
59.8
Supply Chain
87
Quality
71.1
Maintenance
50
Vulnerability
97.3
License
JavaScript (100%)
Total Downloads
6,065
Last Day
16
Last Week
20
Last Month
85
Last Year
425
5 Stars
61 Commits
1 Forks
2 Watching
1 Branches
Minified
Minified + Gzipped
Latest Version
1.3.1
Package Id
keyv-lru-files@1.3.1
Unpacked Size
22.89 kB
Size
7.14 kB
File Count
9
NPM Version
6.14.4
Node Version
14.4.0
Cumulative downloads
Total Downloads
Last day
-15.8%
16
Compared to previous day
Last week
-16.7%
20
Compared to previous week
Last month
107.3%
85
Compared to previous month
Last year
-32.9%
425
Compared to previous year
A file cache inspired by lru-cache.
Least recently used files are deleted. It's helpful if your filesystem uses atime
.
Everything is written to files and nothing is kept in-memory.
npm install keyv-lru-files
1 2var lrufiles = require("keyv-lru-files"); 3 4var cache = new lrufiles({ 5 dir: "cache" // directory to store caches files 6 files: 100, // maximum number of files 7 size: "1 GB", // maximum total file size 8 check: 10, // interval of stale checks in minutes 9}); 10 11// add a file to cache. you can submit a buffer... 12await cache.set("filename.ext", new Buffer("data")); 13 14// ... readable stream ... 15await cache.set("otherfile.ext", fs.createReadableStream("/some/filename.ext")); 16 17// ... or object 18await cache.set("objectfile.json", {hello: "world"}); 19 20// get a file from cache 21// the value is a Buffer 22let value = cache.get("somefile.ext"); 23 24// get a readable stream to a cached file, straight... 25let stream = await cache.stream("anyfile.ext"); 26 27// check if a file is cached 28let exists = await cache.has("filename.ext"); 29 30// update a files access time 31await cache.touch("file/changed.txt"); 32 33// get list of all files cached 34let keys = await cache.keys(); 35 36// remove a file from cache 37let deleted = await cache.delete("file/changed.txt"); 38 39// manually remove old files 40await cache.cache_cleaner(); 41 42// empty everything 43await cache.clear(); 44 45// All functions return a promise so following syntax can be used for all functions 46// this is alternate way when you don't want to use async / await. 47cache.has("filename.ext").then(function(exists){ 48 // do something... 49}).catch(function(err){ 50 // there was error checking file existence 51}); 52
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-20
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More