@thi.ng/cache 2.1.102 → 2.1.104
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/CHANGELOG.md +1 -1
- package/README.md +6 -2
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -216,8 +216,10 @@ instance's default (provided via ctor option arg). If no instance TTL is
|
|
|
216
216
|
given, TTL defaults to 1 hour.
|
|
217
217
|
|
|
218
218
|
```ts
|
|
219
|
+
import { TLRUCache } from "@thi.ng/cache";
|
|
220
|
+
|
|
219
221
|
// same opts as LRUCache, but here with custom TTL period (in ms)
|
|
220
|
-
tlru = new
|
|
222
|
+
tlru = new TLRUCache(null, { ttl: 10000 });
|
|
221
223
|
|
|
222
224
|
// with item specific TTL (500ms)
|
|
223
225
|
tlru.set("foo", 42, 500)
|
|
@@ -228,8 +230,10 @@ tlru.set("foo", 42, 500)
|
|
|
228
230
|
Similar to LRU, but removes most recently accessed items first. [Wikipedia](https://en.wikipedia.org/wiki/Cache_replacement_policies#Most_recently_used_(MRU))
|
|
229
231
|
|
|
230
232
|
```ts
|
|
233
|
+
import { MRUCache } from "@thi.ng/cache";
|
|
234
|
+
|
|
231
235
|
// same opts as LRUCache
|
|
232
|
-
mru = new
|
|
236
|
+
mru = new MRUCache();
|
|
233
237
|
```
|
|
234
238
|
|
|
235
239
|
## Authors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/cache",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.104",
|
|
4
4
|
"description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -32,12 +32,13 @@
|
|
|
32
32
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
33
33
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
34
34
|
"pub": "yarn npm publish --access public",
|
|
35
|
-
"test": "bun test"
|
|
35
|
+
"test": "bun test",
|
|
36
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/dcons": "^3.2.
|
|
40
|
-
"@thi.ng/transducers": "^8.9.
|
|
39
|
+
"@thi.ng/api": "^8.9.28",
|
|
40
|
+
"@thi.ng/dcons": "^3.2.99",
|
|
41
|
+
"@thi.ng/transducers": "^8.9.10"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -90,5 +91,5 @@
|
|
|
90
91
|
],
|
|
91
92
|
"year": 2018
|
|
92
93
|
},
|
|
93
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
|
|
94
95
|
}
|