flat-cache
Advanced tools
Comparing version 3.0.4 to 3.1.0
{ | ||
"name": "flat-cache", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "A stupidly simple key/value storage using files to persist some data", | ||
"repository": "royriojas/flat-cache", | ||
"repository": "jaredwray/flat-cache", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Roy Riojas", | ||
"url": "http://royriojas.com" | ||
"name": "Jared Wray", | ||
"url": "https://jaredwray.com" | ||
}, | ||
@@ -18,3 +18,3 @@ "main": "src/cache.js", | ||
"engines": { | ||
"node": "^10.12.0 || >=12.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
@@ -41,3 +41,4 @@ "precommit": [ | ||
"bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", | ||
"test:cache": "mocha -R spec test/specs", | ||
"test:cache": "c8 mocha -R spec test/specs", | ||
"test:ci:cache": "c8 --reporter=lcov mocha -R spec test/specs", | ||
"test": "npm run verify --silent", | ||
@@ -68,3 +69,4 @@ "cover": "istanbul cover test/runner.js html text-summary", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"c8": "^8.0.1", | ||
"chai": "^4.3.7", | ||
"changelogx": "^5.0.6", | ||
@@ -76,4 +78,3 @@ "eslint": "^7.13.0", | ||
"glob-expand": "^0.2.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^8.2.1", | ||
"mocha": "^10.2.0", | ||
"precommit": "^1.2.2", | ||
@@ -85,5 +86,6 @@ "prepush": "^3.1.11", | ||
"dependencies": { | ||
"flatted": "^3.1.0", | ||
"flatted": "^3.2.7", | ||
"keyv": "^4.5.3", | ||
"rimraf": "^3.0.2" | ||
} | ||
} |
# flat-cache | ||
> A stupidly simple key/value storage using files to persist the data | ||
[![NPM Version](http://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache) | ||
[![Build Status](https://api.travis-ci.org/royriojas/flat-cache.svg?branch=master)](https://travis-ci.org/royriojas/flat-cache) | ||
[![NPM Version](https://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache) | ||
[![tests](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml) | ||
[![codecov](https://codecov.io/github/jaredwray/flat-cache/branch/master/graph/badge.svg?token=KxR95XT3NF)](https://codecov.io/github/jaredwray/flat-cache) | ||
[![npm](https://img.shields.io/npm/dm/flat-cache)](https://npmjs.com/package/flat-cache) | ||
@@ -7,0 +9,0 @@ ## install |
var path = require('path'); | ||
var fs = require('fs'); | ||
var Keyv = require('keyv'); | ||
var utils = require('./utils'); | ||
@@ -20,4 +21,6 @@ var del = require('./del'); | ||
me._visited = {}; | ||
me._persisted = {}; | ||
me.keyv = new Keyv(); | ||
me.__visited = {}; | ||
me.__persisted = {}; | ||
me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId); | ||
@@ -30,2 +33,20 @@ | ||
get _persisted() { | ||
return this.__persisted; | ||
}, | ||
set _persisted(value) { | ||
this.__persisted = value; | ||
this.keyv.set('persisted', value); | ||
}, | ||
get _visited() { | ||
return this.__visited; | ||
}, | ||
set _visited(value) { | ||
this.__visited = value; | ||
this.keyv.set('visited', value); | ||
}, | ||
/** | ||
@@ -32,0 +53,0 @@ * Load the cache from the provided file |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
30750
247
76
3
1
+ Addedkeyv@^4.5.3
+ Addedjson-buffer@3.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
Updatedflatted@^3.2.7