file-entry-cache 5.0.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/cache.js +93 -91
  2. package/changelog.md +44 -30
  3. package/package.json +23 -27
package/cache.js CHANGED
@@ -1,31 +1,31 @@
1
- var path = require( 'path' );
2
- var crypto = require( 'crypto' );
1
+ var path = require('path');
2
+ var crypto = require('crypto');
3
3
 
4
4
  module.exports = {
5
- createFromFile: function ( filePath, useChecksum ) {
6
- var fname = path.basename( filePath );
7
- var dir = path.dirname( filePath );
8
- return this.create( fname, dir, useChecksum );
5
+ createFromFile: function (filePath, useChecksum) {
6
+ var fname = path.basename(filePath);
7
+ var dir = path.dirname(filePath);
8
+ return this.create(fname, dir, useChecksum);
9
9
  },
10
10
 
11
- create: function ( cacheId, _path, useChecksum ) {
12
- var fs = require( 'fs' );
13
- var flatCache = require( 'flat-cache' );
14
- var cache = flatCache.load( cacheId, _path );
15
- var normalizedEntries = { };
11
+ create: function (cacheId, _path, useChecksum) {
12
+ var fs = require('fs');
13
+ var flatCache = require('flat-cache');
14
+ var cache = flatCache.load(cacheId, _path);
15
+ var normalizedEntries = {};
16
16
 
17
17
  var removeNotFoundFiles = function removeNotFoundFiles() {
18
18
  const cachedEntries = cache.keys();
19
19
  // remove not found entries
20
- cachedEntries.forEach( function remover( fPath ) {
20
+ cachedEntries.forEach(function remover(fPath) {
21
21
  try {
22
- fs.statSync( fPath );
22
+ fs.statSync(fPath);
23
23
  } catch (err) {
24
- if ( err.code === 'ENOENT' ) {
25
- cache.removeKey( fPath );
24
+ if (err.code === 'ENOENT') {
25
+ cache.removeKey(fPath);
26
26
  }
27
27
  }
28
- } );
28
+ });
29
29
  };
30
30
 
31
31
  removeNotFoundFiles();
@@ -43,11 +43,8 @@ module.exports = {
43
43
  * @param {Buffer} buffer buffer to calculate hash on
44
44
  * @return {String} content hash digest
45
45
  */
46
- getHash: function ( buffer ) {
47
- return crypto
48
- .createHash( 'md5' )
49
- .update( buffer )
50
- .digest( 'hex' );
46
+ getHash: function (buffer) {
47
+ return crypto.createHash('md5').update(buffer).digest('hex');
51
48
  },
52
49
 
53
50
  /**
@@ -56,8 +53,8 @@ module.exports = {
56
53
  * @param {String} file the filepath to check
57
54
  * @return {Boolean} wheter or not the file has changed
58
55
  */
59
- hasFileChanged: function ( file ) {
60
- return this.getFileDescriptor( file ).changed;
56
+ hasFileChanged: function (file) {
57
+ return this.getFileDescriptor(file).changed;
61
58
  },
62
59
 
63
60
  /**
@@ -69,49 +66,49 @@ module.exports = {
69
66
  * @param {Array} files the files to analyze and compare to the previous seen files
70
67
  * @return {[type]} [description]
71
68
  */
72
- analyzeFiles: function ( files ) {
69
+ analyzeFiles: function (files) {
73
70
  var me = this;
74
- files = files || [ ];
71
+ files = files || [];
75
72
 
76
73
  var res = {
77
74
  changedFiles: [],
78
75
  notFoundFiles: [],
79
- notChangedFiles: []
76
+ notChangedFiles: [],
80
77
  };
81
78
 
82
- me.normalizeEntries( files ).forEach( function ( entry ) {
83
- if ( entry.changed ) {
84
- res.changedFiles.push( entry.key );
79
+ me.normalizeEntries(files).forEach(function (entry) {
80
+ if (entry.changed) {
81
+ res.changedFiles.push(entry.key);
85
82
  return;
86
83
  }
87
- if ( entry.notFound ) {
88
- res.notFoundFiles.push( entry.key );
84
+ if (entry.notFound) {
85
+ res.notFoundFiles.push(entry.key);
89
86
  return;
90
87
  }
91
- res.notChangedFiles.push( entry.key );
92
- } );
88
+ res.notChangedFiles.push(entry.key);
89
+ });
93
90
  return res;
94
91
  },
95
92
 
96
- getFileDescriptor: function ( file ) {
93
+ getFileDescriptor: function (file) {
97
94
  var fstat;
98
95
 
99
96
  try {
100
- fstat = fs.statSync( file );
97
+ fstat = fs.statSync(file);
101
98
  } catch (ex) {
102
- this.removeEntry( file );
99
+ this.removeEntry(file);
103
100
  return { key: file, notFound: true, err: ex };
104
101
  }
105
102
 
106
- if ( useChecksum ) {
107
- return this._getFileDescriptorUsingChecksum( file );
103
+ if (useChecksum) {
104
+ return this._getFileDescriptorUsingChecksum(file);
108
105
  }
109
106
 
110
- return this._getFileDescriptorUsingMtimeAndSize( file, fstat );
107
+ return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
111
108
  },
112
109
 
113
- _getFileDescriptorUsingMtimeAndSize: function ( file, fstat ) {
114
- var meta = cache.getKey( file );
110
+ _getFileDescriptorUsingMtimeAndSize: function (file, fstat) {
111
+ var meta = cache.getKey(file);
115
112
  var cacheExists = !!meta;
116
113
 
117
114
  var cSize = fstat.size;
@@ -120,47 +117,47 @@ module.exports = {
120
117
  var isDifferentDate;
121
118
  var isDifferentSize;
122
119
 
123
- if ( !meta ) {
120
+ if (!meta) {
124
121
  meta = { size: cSize, mtime: cTime };
125
122
  } else {
126
123
  isDifferentDate = cTime !== meta.mtime;
127
124
  isDifferentSize = cSize !== meta.size;
128
125
  }
129
126
 
130
- var nEntry = normalizedEntries[ file ] = {
127
+ var nEntry = (normalizedEntries[file] = {
131
128
  key: file,
132
129
  changed: !cacheExists || isDifferentDate || isDifferentSize,
133
- meta: meta
134
- };
130
+ meta: meta,
131
+ });
135
132
 
136
133
  return nEntry;
137
134
  },
138
135
 
139
- _getFileDescriptorUsingChecksum: function ( file ) {
140
- var meta = cache.getKey( file );
136
+ _getFileDescriptorUsingChecksum: function (file) {
137
+ var meta = cache.getKey(file);
141
138
  var cacheExists = !!meta;
142
139
 
143
140
  var contentBuffer;
144
141
  try {
145
- contentBuffer = fs.readFileSync( file );
142
+ contentBuffer = fs.readFileSync(file);
146
143
  } catch (ex) {
147
144
  contentBuffer = '';
148
145
  }
149
146
 
150
147
  var isDifferent = true;
151
- var hash = this.getHash( contentBuffer );
148
+ var hash = this.getHash(contentBuffer);
152
149
 
153
- if ( !meta ) {
150
+ if (!meta) {
154
151
  meta = { hash: hash };
155
152
  } else {
156
153
  isDifferent = hash !== meta.hash;
157
154
  }
158
155
 
159
- var nEntry = normalizedEntries[ file ] = {
156
+ var nEntry = (normalizedEntries[file] = {
160
157
  key: file,
161
158
  changed: !cacheExists || isDifferent,
162
- meta: meta
163
- };
159
+ meta: meta,
160
+ });
164
161
 
165
162
  return nEntry;
166
163
  },
@@ -173,15 +170,18 @@ module.exports = {
173
170
  * @param files {Array} the array of files to compare against the ones in the cache
174
171
  * @returns {Array}
175
172
  */
176
- getUpdatedFiles: function ( files ) {
173
+ getUpdatedFiles: function (files) {
177
174
  var me = this;
178
- files = files || [ ];
179
-
180
- return me.normalizeEntries( files ).filter( function ( entry ) {
181
- return entry.changed;
182
- } ).map( function ( entry ) {
183
- return entry.key;
184
- } );
175
+ files = files || [];
176
+
177
+ return me
178
+ .normalizeEntries(files)
179
+ .filter(function (entry) {
180
+ return entry.changed;
181
+ })
182
+ .map(function (entry) {
183
+ return entry.key;
184
+ });
185
185
  },
186
186
 
187
187
  /**
@@ -190,13 +190,13 @@ module.exports = {
190
190
  * @param files
191
191
  * @returns {*}
192
192
  */
193
- normalizeEntries: function ( files ) {
194
- files = files || [ ];
193
+ normalizeEntries: function (files) {
194
+ files = files || [];
195
195
 
196
196
  var me = this;
197
- var nEntries = files.map( function ( file ) {
198
- return me.getFileDescriptor( file );
199
- } );
197
+ var nEntries = files.map(function (file) {
198
+ return me.getFileDescriptor(file);
199
+ });
200
200
 
201
201
  //normalizeEntries = nEntries;
202
202
  return nEntries;
@@ -209,9 +209,9 @@ module.exports = {
209
209
  * @method removeEntry
210
210
  * @param entryName
211
211
  */
212
- removeEntry: function ( entryName ) {
213
- delete normalizedEntries[ entryName ];
214
- cache.removeKey( entryName );
212
+ removeEntry: function (entryName) {
213
+ delete normalizedEntries[entryName];
214
+ cache.removeKey(entryName);
215
215
  },
216
216
 
217
217
  /**
@@ -226,23 +226,23 @@ module.exports = {
226
226
  * remove the cache from the file and clear the memory cache
227
227
  */
228
228
  destroy: function () {
229
- normalizedEntries = { };
229
+ normalizedEntries = {};
230
230
  cache.destroy();
231
231
  },
232
232
 
233
- _getMetaForFileUsingCheckSum: function ( cacheEntry ) {
234
- var contentBuffer = fs.readFileSync( cacheEntry.key );
235
- var hash = this.getHash( contentBuffer );
236
- var meta = Object.assign( cacheEntry.meta, { hash: hash } );
233
+ _getMetaForFileUsingCheckSum: function (cacheEntry) {
234
+ var contentBuffer = fs.readFileSync(cacheEntry.key);
235
+ var hash = this.getHash(contentBuffer);
236
+ var meta = Object.assign(cacheEntry.meta, { hash: hash });
237
237
  return meta;
238
238
  },
239
239
 
240
- _getMetaForFileUsingMtimeAndSize: function ( cacheEntry ) {
241
- var stat = fs.statSync( cacheEntry.key );
242
- var meta = Object.assign( cacheEntry.meta, {
240
+ _getMetaForFileUsingMtimeAndSize: function (cacheEntry) {
241
+ var stat = fs.statSync(cacheEntry.key);
242
+ var meta = Object.assign(cacheEntry.meta, {
243
243
  size: stat.size,
244
- mtime: stat.mtime.getTime()
245
- } );
244
+ mtime: stat.mtime.getTime(),
245
+ });
246
246
  return meta;
247
247
  },
248
248
 
@@ -250,37 +250,39 @@ module.exports = {
250
250
  * Sync the files and persist them to the cache
251
251
  * @method reconcile
252
252
  */
253
- reconcile: function ( noPrune ) {
253
+ reconcile: function (noPrune) {
254
254
  removeNotFoundFiles();
255
255
 
256
256
  noPrune = typeof noPrune === 'undefined' ? true : noPrune;
257
257
 
258
258
  var entries = normalizedEntries;
259
- var keys = Object.keys( entries );
259
+ var keys = Object.keys(entries);
260
260
 
261
- if ( keys.length === 0 ) {
261
+ if (keys.length === 0) {
262
262
  return;
263
263
  }
264
264
 
265
265
  var me = this;
266
266
 
267
- keys.forEach( function ( entryName ) {
268
- var cacheEntry = entries[ entryName ];
267
+ keys.forEach(function (entryName) {
268
+ var cacheEntry = entries[entryName];
269
269
 
270
270
  try {
271
- var meta = useChecksum ? me._getMetaForFileUsingCheckSum( cacheEntry ) : me._getMetaForFileUsingMtimeAndSize( cacheEntry );
272
- cache.setKey( entryName, meta );
271
+ var meta = useChecksum
272
+ ? me._getMetaForFileUsingCheckSum(cacheEntry)
273
+ : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
274
+ cache.setKey(entryName, meta);
273
275
  } catch (err) {
274
276
  // if the file does not exists we don't save it
275
277
  // other errors are just thrown
276
- if ( err.code !== 'ENOENT' ) {
278
+ if (err.code !== 'ENOENT') {
277
279
  throw err;
278
280
  }
279
281
  }
280
- } );
282
+ });
281
283
 
282
- cache.save( noPrune );
283
- }
284
+ cache.save(noPrune);
285
+ },
284
286
  };
285
- }
287
+ },
286
288
  };
package/changelog.md CHANGED
@@ -1,14 +1,28 @@
1
1
 
2
2
  # file-entry-cache - Changelog
3
+ ## v6.0.0
4
+ - **Refactoring**
5
+ - Align file-entry-cache with latest eslint - [4c6f1fb]( https://github.com/royriojas/file-entry-cache/commit/4c6f1fb ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:43:09
6
+
7
+
8
+ - Upgrade deps - [8ab3257]( https://github.com/royriojas/file-entry-cache/commit/8ab3257 ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:41:53
9
+
10
+
11
+ - updated packages - [3dd4231]( https://github.com/royriojas/file-entry-cache/commit/3dd4231 ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:29:37
12
+
13
+
14
+ - Upgrade flat-cache to version 3 - [d7c60ef]( https://github.com/royriojas/file-entry-cache/commit/d7c60ef ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:18:04
15
+
16
+
3
17
  ## v5.0.1
4
18
  - **Bug Fixes**
5
- - 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
19
+ - 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 09:30:22
6
20
 
7
21
  Old mode using checkSum can still be used by passing the `useCheckSum` parameter to the `create` or `createFromFile` methods.
8
22
 
9
23
  ## v5.0.0
10
24
  - **Refactoring**
11
- - Make checksum comparison optional - [b0f9ae0]( https://github.com/royriojas/file-entry-cache/commit/b0f9ae0 ), [Roy Riojas](https://github.com/Roy Riojas), 03/02/2019 21:17:39
25
+ - Make checksum comparison optional - [b0f9ae0]( https://github.com/royriojas/file-entry-cache/commit/b0f9ae0 ), [Roy Riojas](https://github.com/Roy Riojas), 03/02/2019 18:17:39
12
26
 
13
27
  To determine if a file has changed we were using the checksum in the newer versions, but eslint was relying on the old behavior where we use the mtime and file size to determine if a file changed. That's why we decided to make the checksum check optional.
14
28
 
@@ -22,120 +36,120 @@
22
36
 
23
37
  ## v4.0.0
24
38
  - **Build Scripts Changes**
25
- - use the same node versions eslint use - [563cfee]( https://github.com/royriojas/file-entry-cache/commit/563cfee ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 23:29:34
39
+ - use the same node versions eslint use - [563cfee]( https://github.com/royriojas/file-entry-cache/commit/563cfee ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 20:29:34
26
40
 
27
41
 
28
42
  - **Other changes**
29
- - Remove object-assign dependency. - [d0f598e]( https://github.com/royriojas/file-entry-cache/commit/d0f598e ), [Corey Farrell](https://github.com/Corey Farrell), 08/01/2019 23:09:51
43
+ - Remove object-assign dependency. - [d0f598e]( https://github.com/royriojas/file-entry-cache/commit/d0f598e ), [Corey Farrell](https://github.com/Corey Farrell), 08/01/2019 20:09:51
30
44
 
31
45
  node.js >=4 is required so object-assign is no longer needed, the native
32
46
  Object.assign can be used instead.
33
47
 
34
48
  ## v3.0.0
35
49
  - **Build Scripts Changes**
36
- - Upgrade flat-cache dep to latest - [078b0df]( https://github.com/royriojas/file-entry-cache/commit/078b0df ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 21:54:40
50
+ - Upgrade flat-cache dep to latest - [078b0df]( https://github.com/royriojas/file-entry-cache/commit/078b0df ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 18:54:40
37
51
 
38
52
 
39
- - Commit new package-lock.json file - [245fe62]( https://github.com/royriojas/file-entry-cache/commit/245fe62 ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 20:56:21
53
+ - Commit new package-lock.json file - [245fe62]( https://github.com/royriojas/file-entry-cache/commit/245fe62 ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 17:56:21
40
54
 
41
55
 
42
56
  - **Refactoring**
43
- - add eslintrc file - [6dd32d8]( https://github.com/royriojas/file-entry-cache/commit/6dd32d8 ), [Roy Riojas](https://github.com/Roy Riojas), 22/08/2018 11:58:17
57
+ - add eslintrc file - [6dd32d8]( https://github.com/royriojas/file-entry-cache/commit/6dd32d8 ), [Roy Riojas](https://github.com/Roy Riojas), 22/08/2018 09:58:17
44
58
 
45
59
 
46
60
  - **Other changes**
47
- - Move variable definition out of else block - [ea05441]( https://github.com/royriojas/file-entry-cache/commit/ea05441 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 25/04/2017 13:19:00
61
+ - Move variable definition out of else block - [ea05441]( https://github.com/royriojas/file-entry-cache/commit/ea05441 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 25/04/2017 11:19:00
48
62
 
49
63
 
50
- - Add script and cmd to test hash/checksum performance - [7f60e0a]( https://github.com/royriojas/file-entry-cache/commit/7f60e0a ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 24/04/2017 16:43:12
64
+ - Add script and cmd to test hash/checksum performance - [7f60e0a]( https://github.com/royriojas/file-entry-cache/commit/7f60e0a ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 24/04/2017 14:43:12
51
65
 
52
66
 
53
- - Calculate md5 hexdigest instead of Adler-32 checksum - [f9e5c69]( https://github.com/royriojas/file-entry-cache/commit/f9e5c69 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 24/04/2017 16:43:12
67
+ - Calculate md5 hexdigest instead of Adler-32 checksum - [f9e5c69]( https://github.com/royriojas/file-entry-cache/commit/f9e5c69 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 24/04/2017 14:43:12
54
68
 
55
69
 
56
- - How to reproduce - [4edc2dc]( https://github.com/royriojas/file-entry-cache/commit/4edc2dc ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 24/04/2017 15:49:32
70
+ - How to reproduce - [4edc2dc]( https://github.com/royriojas/file-entry-cache/commit/4edc2dc ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 24/04/2017 13:49:32
57
71
 
58
72
 
59
- - Test handling of removed files - [09d9ec5]( https://github.com/royriojas/file-entry-cache/commit/09d9ec5 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 19/04/2017 21:51:50
73
+ - Test handling of removed files - [09d9ec5]( https://github.com/royriojas/file-entry-cache/commit/09d9ec5 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 19/04/2017 19:51:50
60
74
 
61
75
 
62
- - Use content checksum instead of mtime and fsize - [343b340]( https://github.com/royriojas/file-entry-cache/commit/343b340 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 19/04/2017 21:51:47
76
+ - Use content checksum instead of mtime and fsize - [343b340]( https://github.com/royriojas/file-entry-cache/commit/343b340 ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 19/04/2017 19:51:47
63
77
 
64
78
 
65
79
  - **Revert**
66
- - Revert "How to reproduce" - [4b4e54a]( https://github.com/royriojas/file-entry-cache/commit/4b4e54a ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 25/04/2017 13:15:36
80
+ - Revert "How to reproduce" - [4b4e54a]( https://github.com/royriojas/file-entry-cache/commit/4b4e54a ), [Zakhar Shapurau](https://github.com/Zakhar Shapurau), 25/04/2017 11:15:36
67
81
 
68
82
  This reverts commit 4edc2dcec01574247bfc2e0a2fe26527332b7df3.
69
83
 
70
84
  ## v2.0.0
71
85
  - **Features**
72
- - do not persist and prune removed files from cache. Relates to [#2](https://github.com/royriojas/file-entry-cache/issues/2) - [408374d]( https://github.com/royriojas/file-entry-cache/commit/408374d ), [Roy Riojas](https://github.com/Roy Riojas), 16/08/2016 15:47:58
86
+ - do not persist and prune removed files from cache. Relates to [#2](https://github.com/royriojas/file-entry-cache/issues/2) - [408374d]( https://github.com/royriojas/file-entry-cache/commit/408374d ), [Roy Riojas](https://github.com/Roy Riojas), 16/08/2016 13:47:58
73
87
 
74
88
 
75
89
  ## v1.3.1
76
90
  - **Build Scripts Changes**
77
- - remove older node version - [0a26ac4]( https://github.com/royriojas/file-entry-cache/commit/0a26ac4 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 06:09:17
91
+ - remove older node version - [0a26ac4]( https://github.com/royriojas/file-entry-cache/commit/0a26ac4 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:09:17
78
92
 
79
93
 
80
94
  ## v1.3.0
81
95
  - **Features**
82
- - Add an option to not prune non visited keys. Closes [#2](https://github.com/royriojas/file-entry-cache/issues/2) - [b1a64db]( https://github.com/royriojas/file-entry-cache/commit/b1a64db ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 05:52:12
96
+ - Add an option to not prune non visited keys. Closes [#2](https://github.com/royriojas/file-entry-cache/issues/2) - [b1a64db]( https://github.com/royriojas/file-entry-cache/commit/b1a64db ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 03:52:12
83
97
 
84
98
 
85
99
  ## v1.2.4
86
100
  - **Enhancements**
87
- - Expose the flat-cache instance - [f34c557]( https://github.com/royriojas/file-entry-cache/commit/f34c557 ), [royriojas](https://github.com/royriojas), 23/09/2015 20:26:33
101
+ - Expose the flat-cache instance - [f34c557]( https://github.com/royriojas/file-entry-cache/commit/f34c557 ), [royriojas](https://github.com/royriojas), 23/09/2015 18:26:33
88
102
 
89
103
 
90
104
  ## v1.2.3
91
105
  - **Build Scripts Changes**
92
- - update flat-cache dep - [cc7b9ce]( https://github.com/royriojas/file-entry-cache/commit/cc7b9ce ), [royriojas](https://github.com/royriojas), 11/09/2015 18:04:44
106
+ - update flat-cache dep - [cc7b9ce]( https://github.com/royriojas/file-entry-cache/commit/cc7b9ce ), [royriojas](https://github.com/royriojas), 11/09/2015 16:04:44
93
107
 
94
108
 
95
109
  ## v1.2.2
96
110
  - **Build Scripts Changes**
97
- - Add changelogx section to package.json - [a3916ff]( https://github.com/royriojas/file-entry-cache/commit/a3916ff ), [royriojas](https://github.com/royriojas), 11/09/2015 18:00:26
111
+ - Add changelogx section to package.json - [a3916ff]( https://github.com/royriojas/file-entry-cache/commit/a3916ff ), [royriojas](https://github.com/royriojas), 11/09/2015 16:00:26
98
112
 
99
113
 
100
114
  ## v1.2.1
101
115
  - **Build Scripts Changes**
102
- - update flat-cache dep - [e49b0d4]( https://github.com/royriojas/file-entry-cache/commit/e49b0d4 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:55:25
116
+ - update flat-cache dep - [e49b0d4]( https://github.com/royriojas/file-entry-cache/commit/e49b0d4 ), [royriojas](https://github.com/royriojas), 11/09/2015 15:55:25
103
117
 
104
118
 
105
119
  - **Other changes**
106
- - Update dependencies Replaced lodash.assign with smaller object-assign Fixed tests for windows - [0ad3000]( https://github.com/royriojas/file-entry-cache/commit/0ad3000 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:44:18
120
+ - Update dependencies Replaced lodash.assign with smaller object-assign Fixed tests for windows - [0ad3000]( https://github.com/royriojas/file-entry-cache/commit/0ad3000 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:44:18
107
121
 
108
122
 
109
123
  ## v1.2.0
110
124
  - **Features**
111
- - analyzeFiles now returns also the files that were removed - [6ac2431]( https://github.com/royriojas/file-entry-cache/commit/6ac2431 ), [royriojas](https://github.com/royriojas), 04/09/2015 14:40:53
125
+ - analyzeFiles now returns also the files that were removed - [6ac2431]( https://github.com/royriojas/file-entry-cache/commit/6ac2431 ), [royriojas](https://github.com/royriojas), 04/09/2015 12:40:53
112
126
 
113
127
 
114
128
  ## v1.1.1
115
129
  - **Features**
116
- - Add method to check if a file hasChanged - [3640e2b]( https://github.com/royriojas/file-entry-cache/commit/3640e2b ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 07:33:32
130
+ - Add method to check if a file hasChanged - [3640e2b]( https://github.com/royriojas/file-entry-cache/commit/3640e2b ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 05:33:32
117
131
 
118
132
 
119
133
  ## v1.1.0
120
134
  - **Features**
121
- - Create the cache directly from a file path - [a23de61]( https://github.com/royriojas/file-entry-cache/commit/a23de61 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:41:33
135
+ - Create the cache directly from a file path - [a23de61]( https://github.com/royriojas/file-entry-cache/commit/a23de61 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 04:41:33
122
136
 
123
137
 
124
- - Add a method to remove an entry from the filecache - [7af29fc]( https://github.com/royriojas/file-entry-cache/commit/7af29fc ), [Roy Riojas](https://github.com/Roy Riojas), 03/03/2015 02:25:32
138
+ - Add a method to remove an entry from the filecache - [7af29fc]( https://github.com/royriojas/file-entry-cache/commit/7af29fc ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 23:25:32
125
139
 
126
140
 
127
- - cache module finished - [1f95544]( https://github.com/royriojas/file-entry-cache/commit/1f95544 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 04:08:08
141
+ - cache module finished - [1f95544]( https://github.com/royriojas/file-entry-cache/commit/1f95544 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 01:08:08
128
142
 
129
143
 
130
144
  - **Build Scripts Changes**
131
- - set the version for the first release - [7472eaa]( https://github.com/royriojas/file-entry-cache/commit/7472eaa ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 04:29:54
145
+ - set the version for the first release - [7472eaa]( https://github.com/royriojas/file-entry-cache/commit/7472eaa ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 01:29:54
132
146
 
133
147
 
134
148
  - **Documentation**
135
- - Updated documentation - [557358f]( https://github.com/royriojas/file-entry-cache/commit/557358f ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 04:29:29
149
+ - Updated documentation - [557358f]( https://github.com/royriojas/file-entry-cache/commit/557358f ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 01:29:29
136
150
 
137
151
 
138
152
  - **Other changes**
139
- - Initial commit - [3d5f42b]( https://github.com/royriojas/file-entry-cache/commit/3d5f42b ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 00:58:29
153
+ - Initial commit - [3d5f42b]( https://github.com/royriojas/file-entry-cache/commit/3d5f42b ), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 21:58:29
140
154
 
141
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-entry-cache",
3
- "version": "5.0.1",
3
+ "version": "6.0.0",
4
4
  "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
5
  "repository": "royriojas/file-entry-cache",
6
6
  "license": "MIT",
@@ -13,14 +13,11 @@
13
13
  "cache.js"
14
14
  ],
15
15
  "engines": {
16
- "node": ">=4"
16
+ "node": "^10.12.0 || >=12.0.0"
17
17
  },
18
18
  "scripts": {
19
- "beautify": "esbeautifier 'cache.js' 'test/**/*.js' 'perf.js'",
20
- "beautify-check": "npm run beautify -- -k",
21
- "eslint": "eslinter 'cache.js' 'specs/**/*.js' 'perf.js'",
22
- "lint": "npm run beautify && npm run eslint",
23
- "verify": "npm run beautify-check && npm run eslint",
19
+ "eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'",
20
+ "autofix": "npm run eslint -- --fix",
24
21
  "install-hooks": "prepush install && changelogx install-hook && precommit install",
25
22
  "changelog": "changelogx -f markdown -o ./changelog.md",
26
23
  "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify",
@@ -29,16 +26,16 @@
29
26
  "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v",
30
27
  "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v",
31
28
  "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v",
32
- "test": "npm run verify --silent && mocha -R spec test/specs",
29
+ "test": "npm run eslint --silent && mocha -R spec test/specs",
33
30
  "perf": "node perf.js",
34
31
  "cover": "istanbul cover test/runner.js html text-summary",
35
32
  "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary"
36
33
  },
37
34
  "prepush": [
38
- "npm run verify"
35
+ "npm run eslint --silent"
39
36
  ],
40
37
  "precommit": [
41
- "npm run verify"
38
+ "npm run eslint --silent"
42
39
  ],
43
40
  "keywords": [
44
41
  "file cache",
@@ -61,24 +58,23 @@
61
58
  "projectName": "file-entry-cache"
62
59
  },
63
60
  "devDependencies": {
64
- "chai": "^3.2.0",
65
- "changelogx": "3.0.0",
66
- "commander": "^2.6.0",
67
- "del": "^2.0.2",
68
- "esbeautifier": "^4.2.11",
69
- "eslinter": "^2.3.3",
70
- "glob-expand": "^0.1.0",
71
- "istanbul": "^0.3.6",
72
- "mocha": "^2.1.0",
73
- "precommit": "^1.1.5",
74
- "prepush": "^3.1.4",
75
- "proxyquire": "^1.3.1",
76
- "sinon": "^1.12.2",
77
- "sinon-chai": "^2.7.0",
78
- "watch-run": "^1.2.1",
79
- "write": "^0.3.1"
61
+ "chai": "^4.2.0",
62
+ "changelogx": "^5.0.6",
63
+ "del": "^6.0.0",
64
+ "eslint": "^7.13.0",
65
+ "eslint-config-prettier": "^6.15.0",
66
+ "eslint-plugin-mocha": "^8.0.0",
67
+ "eslint-plugin-prettier": "^3.1.4",
68
+ "glob-expand": "^0.2.1",
69
+ "istanbul": "^0.4.5",
70
+ "mocha": "^8.2.1",
71
+ "precommit": "^1.2.2",
72
+ "prepush": "^3.1.11",
73
+ "prettier": "^2.1.2",
74
+ "watch-run": "^1.2.5",
75
+ "write": "^2.0.0"
80
76
  },
81
77
  "dependencies": {
82
- "flat-cache": "^2.0.1"
78
+ "flat-cache": "^3.0.4"
83
79
  }
84
80
  }