Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-entry-cache

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-entry-cache - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

25

cache.js

@@ -232,2 +232,19 @@ var path = require( 'path' );

},
_getMetaForFileUsingCheckSum: function ( cacheEntry ) {
var contentBuffer = fs.readFileSync( cacheEntry.key );
var hash = this.getHash( contentBuffer );
var meta = Object.assign( cacheEntry.meta, { hash: hash } );
return meta;
},
_getMetaForFileUsingMtimeAndSize: function ( cacheEntry ) {
var stat = fs.statSync( cacheEntry.key );
var meta = Object.assign( cacheEntry.meta, {
size: stat.size,
mtime: stat.mtime.getTime()
} );
return meta;
},
/**

@@ -244,3 +261,2 @@ * Sync the files and persist them to the cache

var keys = Object.keys( entries );
var me = this;

@@ -251,2 +267,4 @@ if ( keys.length === 0 ) {

var me = this;
keys.forEach( function ( entryName ) {

@@ -256,6 +274,3 @@ var cacheEntry = entries[ entryName ];

try {
var contentBuffer = fs.readFileSync( cacheEntry.key );
var hash = me.getHash( contentBuffer );
var meta = Object.assign( cacheEntry.meta, { hash: hash } );
var meta = useChecksum ? me._getMetaForFileUsingCheckSum( cacheEntry ) : me._getMetaForFileUsingMtimeAndSize( cacheEntry );
cache.setKey( entryName, meta );

@@ -262,0 +277,0 @@ } catch (err) {

# file-entry-cache - Changelog
## v5.0.1
- **Bug Fixes**
- Fix missing checksum comparison from reconcile since now we use mtime and size by default. - [e858aa9]( https://github.com/royriojas/file-entry-cache/commit/e858aa9 ), [Roy Riojas](https://github.com/Roy Riojas), 04/02/2019 12:30:22
Old mode using checkSum can still be used by passing the `useCheckSum` parameter to the `create` or `createFromFile` methods.
## v5.0.0

@@ -4,0 +10,0 @@ - **Refactoring**

2

package.json
{
"name": "file-entry-cache",
"version": "5.0.0",
"version": "5.0.1",
"description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process",

@@ -5,0 +5,0 @@ "repository": "royriojas/file-entry-cache",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc