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.
* update readme links
* quick tweaks
* add badges
* more background
* move Install section down
* Move Example section up
* remove logo.png
* add note about prerelease
* don't need to open
level.js an implementation of the [leveldown](https://github.com/rvagg/node-leveldown)API on top of [IndexedDB](https://developer.mozilla.org/en-US/docs/IndexedDB) (which is in turn implemented on top of [LevelDB](https://code.google.com/p/leveldb/), which brings this whole shebang full circle)
3
+
> An [`abstract-leveldown`](https://github.com/Level/abstract-leveldown)compliant store on top of [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API), which is in turn implemented on top of [LevelDB](https://github.com/google/leveldb) which brings this whole shebang full circle.
4
4
5
-
**Most people use [levelup](http://github.com/rvagg/node-levelup) on top of this library. See `test-levelup.js` for details**
level.js uses [IDBWrapper](https://github.com/jensarps/IDBWrapper) by jensarps to ensure compatibility between IDB implementations.
15
+
- Store large amounts of data in modern browsers
16
+
- Pass the full `abstract-leveldown` test suite
17
+
- Support [Buffer](https://nodejs.org/api/buffer.html) values (in all target environments)
18
+
- Support all key types of IndexedDB Second Edition, including binary keys (depends on environment)
19
+
- Support all value types of the structured clone algorithm (depends on environment)
20
+
- Be as fast as possible
21
+
- Sync with [multilevel](https://github.com/juliangruber/multilevel) over either ASCII or binary transports.
12
22
13
-
Here are the goals of this level.js:
23
+
Being `abstract-leveldown` compliant means you can use many of the [Level modules](https://github.com/Level/awesome/) on top of this library. For some demos of it working, see @brycebaril's presentation [Path of the NodeBases Jedi](http://brycebaril.github.io/nodebase_jedi/#/vanilla).
14
24
15
-
- Store large amounts of ascii (strings, JSON) and binary (Buffer) data in modern browsers
16
-
- Be as fast as possible
17
-
- Use the leveldown test suite and sync with [multilevel](https://github.com/juliangruber/multilevel) over either ascii or binary transports (websockets and xhr both have ascii/binary modes in browsers now)
25
+
## Example
18
26
19
-
Being leveldown compatible means you can use many of the [level-* modules](https://github.com/rvagg/node-levelup/wiki/Modules) on top of this library.
27
+
**This assumes use of version `3.0.0-rc1`. The next release will have an upgrade guide.**
20
28
21
-
## install
29
+
```js
30
+
var levelup =require('levelup')
31
+
var leveljs =require('level-js')
32
+
var db =levelup(leveljs('bigdata'))
22
33
23
-
```sh
24
-
npm install level-js
25
-
```
34
+
db.put('hello', Buffer.from('world'), function (err) {
35
+
if (err) throw err
26
36
27
-
(Not to be confused with [leveljs](https://github.com/rvagg/node-leveljs))
37
+
db.get('hello', function (err, value) {
38
+
if (err) throw err
28
39
29
-
This library is best used with [browserify](http://browserify.org)
40
+
console.log(value.toString()) // 'world'
41
+
})
42
+
})
43
+
```
30
44
31
-
## Browser support
45
+
## Browser Support
32
46
33
47
[](https://saucelabs.com/u/level-js)
34
48
35
-
## code examples
49
+
## Install
36
50
37
-
```js
38
-
var leveljs =require('level-js')
39
-
var db =leveljs('bigdata')
40
-
db.open(functiononOpen() { })
51
+
```bash
52
+
npm install level-js # Stable
53
+
npm install level-js@next # Bleeding edge
41
54
```
42
55
43
-
The test suite for this library is in the [abstract-leveldown](https://github.com/rvagg/node-abstract-leveldown) repo and is shared between various leveldown implementations across different environments and platforms.
56
+
Not to be confused with [leveljs](https://www.npmjs.com/package/leveljs).
44
57
45
-
For more code examples see the [abstract-leveldown test suite](https://github.com/rvagg/node-abstract-leveldown/tree/master/abstract)
58
+
This library is best used with [browserify](http://browserify.org).
`level.js` is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included `LICENSE.md` file for more details.
0 commit comments