flat-cache
Advanced tools
Comparing version 1.3.0 to 1.3.1
12
cache.js
@@ -128,3 +128,5 @@ var path = require( 'path' ); | ||
removeCacheFile: function () { | ||
return del( this._pathToFile, { force: true } ); | ||
return del( this._pathToFile, { | ||
force: true | ||
} ); | ||
}, | ||
@@ -187,3 +189,5 @@ /** | ||
var filePath = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId ); | ||
return del( filePath, { force: true } ).length > 0; | ||
return del( filePath, { | ||
force: true | ||
} ).length > 0; | ||
}, | ||
@@ -197,4 +201,6 @@ /** | ||
var filePath = cacheDir ? path.resolve( cacheDir ) : path.resolve( __dirname, './.cache/' ); | ||
return del( filePath, { force: true } ).length > 0; | ||
return del( filePath, { | ||
force: true | ||
} ).length > 0; | ||
} | ||
}; |
# flat-cache - Changelog | ||
## v1.3.1 | ||
- **Refactoring** | ||
- upgrade deps to remove some security warnings - [f405719]( https://github.com/royriojas/flat-cache/commit/f405719 ), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 15:07:31 | ||
- **Bug Fixes** | ||
- replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892]( https://github.com/royriojas/flat-cache/commit/00f6892 ), [Terry](https://github.com/Terry), 05/11/2018 21:44:16 | ||
- **undefined** | ||
- update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f]( https://github.com/royriojas/flat-cache/commit/d42883f ), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 03:00:44 | ||
Closes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/25"><span>#25</span></a> | ||
## v1.3.0 | ||
@@ -53,3 +66,3 @@ - **Other changes** | ||
## v1.0.11 | ||
## v1.1.0 | ||
- **Features** | ||
@@ -85,4 +98,2 @@ - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:00:29 | ||
## v1.0.10 | ||
- **Build Scripts Changes** | ||
- add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08 | ||
@@ -131,11 +142,75 @@ | ||
## v1.0.4 | ||
## v1.0.11 | ||
- **Features** | ||
- Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:00:29 | ||
- Add json read and write utility based on circular-json - [c31081e]( https://github.com/royriojas/flat-cache/commit/c31081e ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:58:17 | ||
- **Bug Fixes** | ||
- Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:18:06 | ||
Since we control both writing and reading of JSON stream, there no needs | ||
to handle unicode BOM. | ||
- Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed]( https://github.com/royriojas/flat-cache/commit/cd7aeed ), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 13:11:59 | ||
- **Tests Related fixes** | ||
- Add missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:15:51 | ||
- Add test for circular json serialization / deserialization - [07d2ddd]( https://github.com/royriojas/flat-cache/commit/07d2ddd ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:36 | ||
- **Refactoring** | ||
- load a cache file using the full filepath - [b8f68c2]( https://github.com/royriojas/flat-cache/commit/b8f68c2 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:19:14 | ||
- Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:18 | ||
- **Build Scripts Changes** | ||
- travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 17:34:40 | ||
## v1.0.10 | ||
- **Build Scripts Changes** | ||
- add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08 | ||
- make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 14:54:48 | ||
- test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:51:39 | ||
- Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 16:44:31 | ||
- **Other changes** | ||
- add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 23:02:18 | ||
- Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:10:57 | ||
- Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:47:41 | ||
- **Bug Fixes** | ||
- wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:59:30 | ||
- **Documentation** | ||
- Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 16:48:05 | ||
- better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 16:35:33 | ||
- Add documentation about `clearAll` and `clearCacheById` - [13947c1]( https://github.com/royriojas/flat-cache/commit/13947c1 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:44:05 | ||
- **Refactoring** | ||
- load a cache file using the full filepath - [b8f68c2]( https://github.com/royriojas/flat-cache/commit/b8f68c2 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:19:14 | ||
- **Features** | ||
@@ -142,0 +217,0 @@ - Add methods to remove the cache documents created - [af40443]( https://github.com/royriojas/flat-cache/commit/af40443 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:39:27 |
{ | ||
"name": "flat-cache", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A stupidly simple key/value storage using files to persist some data", | ||
@@ -26,5 +26,5 @@ "repository": "royriojas/flat-cache", | ||
"scripts": { | ||
"beautify": "esbeautifier 'cache.js' 'test/specs/**/*.js'", | ||
"beautify": "esbeautifier cache.js test/specs/**/*.js", | ||
"beautify-check": "npm run beautify -- -k", | ||
"eslint": "eslinter 'cache.js' 'utils.js' 'specs/**/*.js'", | ||
"eslint": "eslinter cache.js utils.js specs/**/*.js", | ||
"eslint-fix": "npm run eslint -- --fix", | ||
@@ -69,8 +69,8 @@ "autofix": "npm run beautify && npm run eslint-fix", | ||
"chai": "^3.2.0", | ||
"changelogx": "^1.0.18", | ||
"esbeautifier": "^6.1.8", | ||
"changelogx": "3.0.0", | ||
"esbeautifier": "10.1.1", | ||
"eslinter": "^3.2.1", | ||
"glob-expand": "^0.1.0", | ||
"istanbul": "^0.3.19", | ||
"mocha": "^2.3.2", | ||
"glob-expand": "0.2.1", | ||
"istanbul": "0.4.5", | ||
"mocha": "5.2.0", | ||
"precommit": "^1.1.5", | ||
@@ -84,4 +84,4 @@ "prepush": "^3.1.4", | ||
"dependencies": { | ||
"circular-json": "^0.3.1", | ||
"del": "^2.0.2", | ||
"del": "^3.0.0", | ||
"flatted": "^2.0.0", | ||
"graceful-fs": "^4.1.2", | ||
@@ -88,0 +88,0 @@ "write": "^0.2.1" |
10
utils.js
var fs = require( 'graceful-fs' ); | ||
var write = require( 'write' ); | ||
var circularJson = require( 'circular-json' ); | ||
var flatted = require( 'flatted' ); | ||
@@ -18,3 +18,3 @@ module.exports = { | ||
/** | ||
* Read json file synchronously using circular-json | ||
* Read json file synchronously using flatted | ||
* | ||
@@ -26,7 +26,7 @@ * @method readJSON | ||
readJSON: function ( filePath ) { | ||
return circularJson.parse( fs.readFileSync( filePath ).toString() ); | ||
return flatted.parse( fs.readFileSync( filePath ).toString() ); | ||
}, | ||
/** | ||
* Write json file synchronously using circular-json | ||
* Write json file synchronously using flatted | ||
* | ||
@@ -38,5 +38,5 @@ * @method writeJSON | ||
writeJSON: function (filePath, data ) { | ||
write.sync( filePath, circularJson.stringify( data ) ); | ||
write.sync( filePath, flatted.stringify( data ) ); | ||
} | ||
}; |
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
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
25682
218
+ Addedflatted@^2.0.0
+ Addeddel@3.0.0(transitive)
+ Addedflatted@2.0.2(transitive)
+ Addedglobby@6.1.0(transitive)
+ Addedp-map@1.2.0(transitive)
+ Addedpify@3.0.0(transitive)
- Removedcircular-json@^0.3.1
- Removedarrify@1.0.1(transitive)
- Removedcircular-json@0.3.3(transitive)
- Removeddel@2.2.2(transitive)
- Removedglobby@5.0.0(transitive)
Updateddel@^3.0.0