Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Commit 6721302

Browse files
authored
Tweak readme (#102)
* 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
1 parent e62af6f commit 6721302

File tree

2 files changed

+43
-29
lines changed

2 files changed

+43
-29
lines changed

Diff for: README.md

+43-29
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,72 @@
1-
![logo](logo.png)
1+
# level-js
22

3-
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.
44
5-
**Most people use [levelup](http://github.com/rvagg/node-levelup) on top of this library. See `test-levelup.js` for details**
5+
[![level badge][level-badge]](https://github.com/level/awesome)
6+
[![npm](https://img.shields.io/npm/v/level-js.svg)](https://www.npmjs.com/package/level-js)
7+
[![npm next](https://img.shields.io/npm/v/level-js/next.svg)](https://www.npmjs.com/package/level-js)
8+
[![Travis](https://secure.travis-ci.org/Level/level.js.svg?branch=master)](http://travis-ci.org/Level/level.js)
9+
[![npm](https://img.shields.io/npm/dm/level-js.svg)](https://www.npmjs.com/package/level-js)
610

7-
For some demos of it working, see @brycebaril's presentation "Path of the NodeBases Jedi": http://brycebaril.github.io/nodebase_jedi/#/vanilla
11+
## Background
812

9-
[![NPM](https://nodei.co/npm/level-js.png)](https://nodei.co/npm/level-js/)
13+
Here are the goals of `level-js`:
1014

11-
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.
1222

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).
1424

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
1826

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.**
2028

21-
## install
29+
```js
30+
var levelup = require('levelup')
31+
var leveljs = require('level-js')
32+
var db = levelup(leveljs('bigdata'))
2233

23-
```sh
24-
npm install level-js
25-
```
34+
db.put('hello', Buffer.from('world'), function (err) {
35+
if (err) throw err
2636

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
2839

29-
This library is best used with [browserify](http://browserify.org)
40+
console.log(value.toString()) // 'world'
41+
})
42+
})
43+
```
3044

31-
## Browser support
45+
## Browser Support
3246

3347
[![Sauce Test Status](https://saucelabs.com/browser-matrix/level-js.svg)](https://saucelabs.com/u/level-js)
3448

35-
## code examples
49+
## Install
3650

37-
```js
38-
var leveljs = require('level-js')
39-
var db = leveljs('bigdata')
40-
db.open(function onOpen() { })
51+
```bash
52+
npm install level-js # Stable
53+
npm install level-js@next # Bleeding edge
4154
```
4255

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).
4457

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).
4659

47-
## run the tests
60+
## Running Tests
4861

4962
```sh
50-
git clone [email protected]:maxogden/level.js.git
63+
git clone [email protected]:Level/level.js.git
5164
cd level.js
5265
npm install
5366
npm test
54-
open localhost:9966
5567
```
5668

57-
Then look in your browser console
69+
It will print out a URL to open in a browser of choice.
5870

5971
## Big Thanks
6072

@@ -67,3 +79,5 @@ Cross-browser Testing Platform and Open Source ♥ Provided by [Sauce Labs](http
6779
Copyright (c) 2012-2018 `level.js` [contributors](https://github.com/level/community#contributors).
6880

6981
`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.
82+
83+
[level-badge]: http://leveldb.org/img/badge.svg

Diff for: logo.png

-2.11 KB
Binary file not shown.

0 commit comments

Comments
 (0)