fast-ttl-cache 0.0.2 → 0.0.3

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 (2) hide show
  1. package/README.md +4 -0
  2. package/package.json +7 -3
package/README.md CHANGED
@@ -36,16 +36,20 @@ cache.size; // return 0
36
36
 
37
37
  ## API
38
38
  ``` FastTTLCache(options) consturctor```
39
+
39
40
  options.ttl: number of millseconds, defaults to Infinity
40
41
  options.capacity: number of max capacity, defaults to Infinity
41
42
 
42
43
  ```FastTTLCache.prototype.put(key, value)```
44
+
43
45
  Add or update the value into cache with key and timestamp.
44
46
 
45
47
  ```FastTTLCache.prototype.get(key)```
48
+
46
49
  Get the value of the key from cache, return null if the key is not exists or has been expired.
47
50
 
48
51
  ``` FastTTLCache.prototype.size```
52
+
49
53
  return the current size of cache.
50
54
 
51
55
  ## License
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "fast-ttl-cache",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "ttl cache with capacity support use no timer",
5
- "type": "module",
6
- "module": "index.mjs",
5
+ "module": "./index.mjs",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./index.mjs"
9
+ }
10
+ },
7
11
  "author": "linye<llxy8687@foxmail.com>",
8
12
  "license": "MIT"
9
13
  }