Socket
Socket
Sign inDemoInstall

flat-cache

Package Overview
Dependencies
31
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc