Installations
npm install keyv-lru-files
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.4.0
NPM Version
6.14.4
Score
59.8
Supply Chain
87
Quality
71.1
Maintenance
50
Vulnerability
97.3
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
gumlet
Download Statistics
Total Downloads
6,065
Last Day
16
Last Week
20
Last Month
85
Last Year
425
GitHub Statistics
5 Stars
61 Commits
1 Forks
2 Watching
1 Branches
Bundle Size
565.78 kB
Minified
247.44 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
6,065
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Keyv lru files
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.
Install
npm install keyv-lru-files
Usgae
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/gumlet/keyv-lru-files/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/gumlet/keyv-lru-files/nodejs.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:23
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
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
- Warn: no pull requests merged into dev branch
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3.4
/10
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