Comparing version 6.0.0 to 6.0.1
{ | ||
"name": "cachu", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "A simple key-value cache for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -17,3 +17,6 @@ # cachu | ||
const cache = useCache() | ||
const cache = useCache({ | ||
maxAge: '10m', // 10 minutes, can be specified as number (in seconds) or readable string | ||
... | ||
}) | ||
@@ -28,23 +31,23 @@ // Add a new entry. | ||
* #### Configuration | ||
* #### Configuration (optional) | ||
* [`maxAge`](https://github.com/azurydev/cachu/blob/dev/guide/guide/config/maxAge.md) to set the **maximum age** for each record in the cache | ||
* [`maxAmount`](https://github.com/azurydev/cachu/blob/dev/guide/config/maxAmount.md) to set the **maximum size** for the cache | ||
* [`autodelete`](https://github.com/azurydev/cachu/blob/dev/guide/config/autodelete.md) to **delete overaged entries** on adding/updating | ||
* `maxAge` to set the **maximum age** for each record in the cache *(defaults to 600s)* | ||
* `maxAmount` to set the **maximum size** for the cache *(defaults to 10000)* | ||
* `autodelete` to **delete overaged entries** on adding/updating *(disabled by default)* | ||
* #### Features | ||
* [`add()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/add.md) | ||
* [`addMany()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/addMany.md) | ||
* [`get()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/get.md) | ||
* [`getMany()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/getMany.md) | ||
* [`update()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/update.md) | ||
* [`updateMany()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/updateMany.md) | ||
* [`remove()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/remove.md) | ||
* [`removeMany()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/removeMany.md) | ||
* [`has()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/has.md) | ||
* [`size()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/size.md) | ||
* [`keys()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/keys.md) | ||
* [`values()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/values.md) | ||
* [`clear()`](https://github.com/azurydev/cachu/blob/dev/guide/guide/features/clear.md) | ||
* `add()` | ||
* `addMany()` | ||
* `get()` | ||
* `getMany()` | ||
* `update()` | ||
* `updateMany()` | ||
* `remove()` | ||
* `removeMany()` | ||
* `has()` | ||
* `size()` *(get the cache size in bytes)* | ||
* `keys()` | ||
* `values()` | ||
* `clear()` *(delete all overaged entries manually)* | ||
@@ -51,0 +54,0 @@ <hr> |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
58
0
18044