You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,20 @@ Not to be confused with [leveljs](https://www.npmjs.com/package/leveljs).
58
58
59
59
This library is best used with [browserify](http://browserify.org).
60
60
61
+
## API
62
+
63
+
### `db = leveljs(location[, options])`
64
+
Returns a new `leveljs` instance. `location` is the string name of the [`IDBDatabase`](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase) to be opened, as well as the object store within that database. The database name will be prefixed with `options.prefix`.
65
+
66
+
#### `options`
67
+
68
+
The optional `options` argument may contain:
69
+
70
+
*`prefix`*(string, default: `'level-js-'`)*: Prefix for `IDBDatabase` name.
71
+
*`version`*(string | number, default: `1`)*: The version to open the database with.
72
+
73
+
See [`IDBFactory#open`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open) for more details.
0 commit comments