file-entry-cache 11.1.2 → 11.1.5

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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # file-entry-cache
4
4
  > A lightweight cache for file metadata, ideal for processes that work on a specific set of files and only need to reprocess files that have changed since the last run
5
5
 
6
- [![codecov](https://codecov.io/gh/jaredwray/cacheable/graph/badge.svg?token=lWZ9OBQ7GM)](https://codecov.io/gh/jaredwray/cacheable)
6
+ [![codecov](https://codecov.io/gh/jaredwray/cacheable/branch/main/graph/badge.svg?token=lWZ9OBQ7GM)](https://codecov.io/gh/jaredwray/cacheable)
7
7
  [![tests](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml/badge.svg)](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml)
8
8
  [![npm](https://img.shields.io/npm/dm/file-entry-cache.svg)](https://www.npmjs.com/package/file-entry-cache)
9
9
  [![npm](https://img.shields.io/npm/v/file-entry-cache)](https://www.npmjs.com/package/file-entry-cache)
@@ -61,8 +61,12 @@ let fileDescriptor = cache.getFileDescriptor('./src/file.txt');
61
61
  console.log(fileDescriptor.changed); // true as it is the first time
62
62
  console.log(fileDescriptor.key); // './src/file.txt' (stored as provided)
63
63
 
64
+ // Repeated calls keep reporting `changed: true` until you persist the state
65
+ // with reconcile(); only then does the file become the cached baseline.
66
+ cache.reconcile();
67
+
64
68
  fileDescriptor = cache.getFileDescriptor('./src/file.txt');
65
- console.log(fileDescriptor.changed); // false as it has not changed
69
+ console.log(fileDescriptor.changed); // false as it has not changed since reconcile()
66
70
 
67
71
  // do something to change the file
68
72
  fs.writeFileSync('./src/file.txt', 'new data foo bar');