Skip to content

Commit ce611b9

Browse files
committed
docs: refine README
1 parent 4233aba commit ce611b9

File tree

6 files changed

+9
-28
lines changed

6 files changed

+9
-28
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
**Keyval** is a small key/value storage layer with a consistent API across environments and backends:
88

9-
* **In-memory** (fast, ephemeral)
10-
* **Browser storage** (WebStorage, IndexedDB, Cookie Store)
11-
* **File storage** (Node.js)
12-
* **Redis** (shared server-side storage)
9+
* **In-memory backend** (fast, ephemeral)
10+
* **Browser storage backend** (WebStorage, IndexedDB, Cookie Store)
11+
* **File storage backend** (Node.js)
12+
* **Redis backend** (shared server-side storage)
1313

1414
It gives you a simple dictionary API for state—regardless of where that state physically lives.
1515

@@ -113,24 +113,23 @@ await kv.set('flags', { beta: true });
113113
But Keyval diverges from the `Map` contract in a few ways:
114114

115115
* Methods are async.
116-
* An async `.count()` method as the equivalent of `Map.size`.
116+
* An async `.count()` method is the equivalent of `Map.size`.
117117
* No `.forEach()` method. You use `.entries()` instead.
118118

119119
And Keyval extends the contract with additional methods like `.observe()`, `.close()`, etc.
120120

121121
### 3. Field metadata
122122

123-
Keyval ensures a transparent mapping between what you set and what you get. But internally, each key is held as a **metadata object** containing the actual value and optional metadata. This typically looks like:
123+
Keyval ensures a transparent mapping between what you set and what you get. But internally, each key is held as a **metadata object** containing the actual value and optional user-supplied metadata. This typically looks like:
124124

125125
```ts
126126
{
127127
value: any,
128-
expires?: number,
129-
...metadata
128+
...meta
130129
}
131130
```
132131

133-
This makes it possible to support field-level metadata (e.g. field-level expiry, etc.) when needed:
132+
This makes it possible to support field-level metadata when needed:
134133

135134
```js
136135
kv.set('key1', 22);

dist/idb.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)