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 Mar 23, 2023. It is now read-only.
@@ -37,15 +32,18 @@ import { LevelDatastore } from 'datastore-level'
37
32
// Default using level as backend for node or the browser
38
33
conststore=newLevelDatastore('path/to/store')
39
34
40
-
// another leveldown compliant backend like memdown
41
-
constmemStore=newLevelDatastore('my/mem/store', {
42
-
db:require('level-mem')
43
-
})
35
+
// another leveldown compliant backend like memory-level
36
+
constmemStore=newLevelDatastore(
37
+
newMemoryLevel({
38
+
keyEncoding:'utf8',
39
+
valueEncoding:'view'
40
+
})
41
+
)
44
42
```
45
43
46
44
### Browser Shimming Leveldown
47
45
48
-
`LevelStore` uses the `level` module to automatically use `level.js` if a modern bundler is used which can detect bundle targets based on the `pkg.browser` property in your `package.json`.
46
+
`LevelStore` uses the `level` module to automatically use `level` if a modern bundler is used which can detect bundle targets based on the `pkg.browser` property in your `package.json`.
49
47
50
48
If you are using a bundler that does not support `pkg.browser`, you will need to handle the shimming yourself, as was the case with versions of `LevelStore` 0.7.0 and earlier.
51
49
@@ -55,8 +53,8 @@ If you are using a bundler that does not support `pkg.browser`, you will need to
55
53
56
54
```javascript
57
55
importleveljsfrom'level-js'
58
-
import browserStore = new LevelDatastore('my/db/name', {
59
-
db: (path) => leveljs(path, {
56
+
import browserStore = new LevelDatastore(
57
+
newLevel('my/db/name', {
60
58
prefix:'IDBWrapper-'
61
59
})
62
60
})
@@ -74,4 +72,15 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
0 commit comments