Skip to content

Commit b11345f

Browse files
Update README.md
1 parent 370de53 commit b11345f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const cache = new Cache({
9797

9898
In lrujs any value (both objects and primitive values) may be used as either a key or a value, duplicate keys not allowed and if duplicate item is inserted it will be replaced by the new item.
9999

100-
````js
100+
```js
101101
// Add new data in cache
102102
cache.set("a", 10);
103103

@@ -106,6 +106,7 @@ cache.set("user", { name: "abc" });
106106

107107
// Add duplicate data
108108
cache.set("a", 20); // Replace the old value
109+
```
109110

110111
## Set ttl for single data
111112

@@ -114,7 +115,7 @@ By default the configuration TTL value is used for every item, but we can set TT
114115
```js
115116
// Add new data in cache
116117
cache.set("b", 10, { ttl: 200 }); // Expires after 200 ms
117-
````
118+
```
118119

119120
## Get data from cache
120121

0 commit comments

Comments
 (0)