Skip to content

Commit d565648

Browse files
Update README.md
1 parent 083f73a commit d565648

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
@@ -100,7 +100,7 @@ const cache = new Cache({
100100

101101
In cachejs 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.
102102

103-
````js
103+
```js
104104
// Add new data in cache
105105
cache.set("a", 10);
106106

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

110110
// Add duplicate data
111111
cache.set("a", 20); // Replace the old value
112+
```
112113

113114
## Set ttl for single data
114115

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

122123
## Get data from cache
123124

0 commit comments

Comments
 (0)