🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

flat-cache

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat-cache - npm Package Compare versions

Comparing version

to
1.0.2

23

cache.js

@@ -5,2 +5,3 @@ var path = require( 'path' );

var write = require( 'write' );
var del = require('del').sync;

@@ -113,3 +114,25 @@ var cache = {

return obj;
},
/**
* Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly
*
* @method clearCache
* @param docId {String} the id of the cache, would also be used as the name of the file cache
* @returns {Boolean} true if the cache folder was deleted. False otherwise
*/
clearCacheById: function (docId) {
return del(path.resolve( __dirname, './.cache/', docId ), {
force: true
}).length > 0;
},
/**
* Remove all cache stored in the cache directory
* @method clearAll
* @returns {Boolean} true if the cache folder was deleted. False otherwise
*/
clearAll: function () {
return del(path.resolve( __dirname, './.cache/'), {
force: true
}).length > 0;
}
};

4

package.json
{
"name": "flat-cache",
"version": "1.0.1",
"version": "1.0.2",
"description": "A stupidly simple key/value storage using files to persist the data",

@@ -33,3 +33,2 @@ "repository": "royriojas/flat-cache",

"chai": "^2.1.0",
"del": "^1.1.1",
"glob-expand": "0.0.2",

@@ -44,2 +43,3 @@ "istanbul": "^0.3.6",

"dependencies": {
"del": "^1.1.1",
"graceful-fs": "^3.0.5",

@@ -46,0 +46,0 @@ "read-json-sync": "^1.1.0",