## Overview
-The `json_cache_rw` package exports a single constructor `JSONCacheRW(diag)`
-which must be called with the `new` operator. The resulting cache object stores
+The `json_cache_rw` package exports a single constructor
+ `JSONCacheRW(diag)`
+which must be called with the `new` operator. The resulting cache object stores
arbitrary node.js JSON objects, which are read from disk files and modified
(repeatedly) during the execution of your program. The cache tracks the on-disk
pathname of the object, and writes it back to there after a delay time. A
## Calling API
Suppose one has a `JSONCacheRW` instance named `jcrw`. It behaves somewhat like
- an ES6 `Map` instance that maps pathname strings to JSON objects, except that
+an ES6 `Map` instance that maps pathname strings to JSON objects, except that
it has `jcrw.read()`, `jcrw.write()`, and `jcrw.modify()` functions instead of
`get` and `set`, and new objects are added to the cache by attempting to `read`
them.
out that involves several different JSON files, special precautions need to be
taken. We will use an example of a money-transfer application with two files,
`transactions.json` containing a log of transactions (an array that) and
-`balances.json` with account balances (a dictionary indexed by account number).
+`balances.json` with account balances (a dictionary indexed by account number).
To modify the transaction log consistently with the account balances in atomic
fashion, both files should be locked by nesting the modifications. A consistent
## Contributions
-We would greatly welcome your feedback and contributions. The `json_cache_rw`
-is under active development (and is part of a larger project that is also under
-development) and thus the API is considered tentative and subject to change. If
-this is undesirable, you could possibly pin the version in your `package.json`.
+The caching system is under active development (and is part of a larger project
+that is also under development) and thus the API is tentative. Please go ahead
+and incorporate the system into your project, or try out our example webserver
+built on the system, subject to the caution that the API could change. Please
+send us your experience and feedback, and let us know of improvements you make.
Contact: Nick Downing <nick@ndcode.org>