From 120b0df706f0a3785c6d1e78c878b8866838f7d8 Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Sun, 27 May 2018 14:30:17 +0200 Subject: [PATCH 1/4] Document constructor --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 46f8d53..143882c 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,20 @@ Not to be confused with [leveljs](https://www.npmjs.com/package/leveljs). This library is best used with [browserify](http://browserify.org). +## API + +### `db = leveljs(location[, options])` +Returns a new `leveljs` instance. `location` is a String pointing to the IndexedDB location to be opened. + +#### `options` + +The optional `options` argument may contain: + +* `prefix` *(string, default: `'level-js-'`)*: Prepended to the location for the underlying IndexedDB store. +* `version` *(string | number, default: `1`)*: The version to open the database with. + +See [`IDBFactory#open`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open) for more details. + ## Running Tests ```sh From 405b4ca9bc20678c80e98f71b7849edddec8771f Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Sun, 27 May 2018 14:38:08 +0200 Subject: [PATCH 2/4] tweak location docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 143882c..1d7d3c3 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ This library is best used with [browserify](http://browserify.org). ## API ### `db = leveljs(location[, options])` -Returns a new `leveljs` instance. `location` is a String pointing to the IndexedDB location to be opened. +Returns a new `leveljs` instance. `location` is the string name of the IndexedDB object store to be opened. #### `options` From 812358956ec358f681d12b04558bfd4f9fbeacf0 Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Sun, 27 May 2018 14:54:55 +0200 Subject: [PATCH 3/4] update options.prefix docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d7d3c3..8acc2e6 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Returns a new `leveljs` instance. `location` is the string name of the IndexedDB The optional `options` argument may contain: -* `prefix` *(string, default: `'level-js-'`)*: Prepended to the location for the underlying IndexedDB store. +* `prefix` *(string, default: `'level-js-'`)*: Prefix for `IDBDatabase` name. * `version` *(string | number, default: `1`)*: The version to open the database with. See [`IDBFactory#open`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open) for more details. From c1437d381c35f4366d2b729e4ec0a0a18e85f129 Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Sun, 27 May 2018 15:00:11 +0200 Subject: [PATCH 4/4] update location docs once more --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8acc2e6..7662fb6 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ This library is best used with [browserify](http://browserify.org). ## API ### `db = leveljs(location[, options])` -Returns a new `leveljs` instance. `location` is the string name of the IndexedDB object store to be opened. +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`. #### `options`