Gathering detailed insights and metrics for keyv-file
Gathering detailed insights and metrics for keyv-file
Gathering detailed insights and metrics for keyv-file
Gathering detailed insights and metrics for keyv-file
npm install keyv-file
93.8
Supply Chain
87
Quality
81.3
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
69 Stars
63 Commits
10 Forks
3 Watching
1 Branches
7 Contributors
Updated on 04 Nov 2024
Minified
Minified + Gzipped
TypeScript (94.07%)
JavaScript (5.93%)
Cumulative downloads
Total Downloads
Last day
-15.8%
3,792
Compared to previous day
Last week
0.6%
23,013
Compared to previous week
Last month
-6.3%
100,885
Compared to previous month
Last year
239.3%
902,805
Compared to previous year
3
File storage adapter for Keyv, using json to serialize data fast and small.
File storage adapter for Keyv.
TTL functionality is handled internally by interval scan, don't need to panic about expired data take too much space.
1npm install --save keyv keyv-file
1const Keyv = require('keyv')
2const { KeyvFile } = require('keyv-file')
3
4const keyv = new Keyv({
5 store: new KeyvFile()
6});
7// More options with default value:
8const customKeyv = new Keyv({
9 store: new KeyvFile({
10 filename: `${os.tmpdir()}/keyv-file/default-rnd-${Math.random().toString(36).slice(2)}.json`, // the file path to store the data
11 expiredCheckDelay: 24 * 3600 * 1000, // ms, check and remove expired data in each ms
12 writeDelay: 100, // ms, batch write to disk in a specific duration, enhance write performance.
13 encode: JSON.stringify, // serialize function
14 decode: JSON.parse // deserialize function
15 })
16})
1import KeyvFile, { makeField } from 'keyv-file' 2 3class Kv extends KeyvFile { 4 constructor() { 5 super({ 6 filename: './db.json' 7 }) 8 } 9 someField = makeField(this, 'field_key') 10} 11 12export const kv = new Kv 13 14kv.someField.get(1) // empty return default value 1 15kv.someField.set(2) // set value 2 16kv.someField.get() // return saved value 2 17kv.someField.delete() // delete field
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
11 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 5/29 approved changesets -- score normalized to 1
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
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
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