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

Commit 24c2060

Browse files
authored
Apply common project tweaks (round 2) (#635)
* Add dependency-check * Add Donate section and badges to README.md * Unlock 7 devDependencies * Run hallmark * Tweak badges and links in README.md * Fix 'Link to unknown heading(s)' in README.md * Remove README.md from hallmark ignore option * Run hallmark
1 parent b83add5 commit 24c2060

3 files changed

Lines changed: 58 additions & 45 deletions

File tree

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
| **Lars-Magnus Skog** | [**@ralphtheninja**](https://github.com/ralphtheninja) | [**@ralph@social.weho.st**](https://social.weho.st/@ralph) |
66
| **Rod Vagg** | [**@rvagg**](https://github.com/rvagg) | [**@rvagg@twitter**](https://twitter.com/rvagg) |
77
| **Julian Gruber** | [**@juliangruber**](https://github.com/juliangruber) | [**@juliangruber@twitter**](https://twitter.com/juliangruber) |
8-
| **Vincent Weevers** | [**@vweevers**](https://github.com/vweevers) | [**@vweevers@twitter**](https://twitter.com/vweevers) |
98
| **Dominic Tarr** | [**@dominictarr**](https://github.com/dominictarr) | [**@dominictarr@twitter**](https://twitter.com/dominictarr) |
9+
| **Vincent Weevers** | [**@vweevers**](https://github.com/vweevers) | [**@vweevers@twitter**](https://twitter.com/vweevers) |
1010
| **Matteo Collina** | [**@mcollina**](https://github.com/mcollina) | [**@matteocollina@twitter**](https://twitter.com/matteocollina) |
1111
| **James Halliday** | [**@substack**](https://github.com/substack) | [**@substack@twitter**](https://twitter.com/substack) |
1212
| **David Björklund** | [**@kesla**](https://github.com/kesla) | [**@david_bjorklund@twitter**](https://twitter.com/david_bjorklund) |

README.md

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# levelup
22

3-
[![level badge][level-badge]](https://github.com/level/awesome)
4-
[![npm](https://img.shields.io/npm/v/levelup.svg)](https://www.npmjs.com/package/levelup)
5-
![Node version](https://img.shields.io/node/v/levelup.svg)
6-
[![Build Status](https://secure.travis-ci.org/Level/levelup.svg?branch=master)](http://travis-ci.org/Level/levelup)
7-
[![dependencies](https://david-dm.org/Level/levelup.svg)](https://david-dm.org/level/levelup)
8-
[![npm](https://img.shields.io/npm/dm/levelup.svg)](https://www.npmjs.com/package/levelup)
3+
[![level badge][level-badge]](https://github.com/Level/awesome)
4+
[![npm](https://img.shields.io/npm/v/levelup.svg?label=&logo=npm)](https://www.npmjs.com/package/levelup)
5+
[![Node version](https://img.shields.io/node/v/levelup.svg)](https://www.npmjs.com/package/levelup)
6+
[![Travis](https://img.shields.io/travis/Level/levelup.svg?logo=travis&label=)](https://travis-ci.org/Level/levelup)
7+
[![npm](https://img.shields.io/npm/dm/levelup.svg?label=dl)](https://www.npmjs.com/package/levelup)
98
[![Coverage Status](https://coveralls.io/repos/github/Level/levelup/badge.svg)](https://coveralls.io/github/Level/levelup)
109
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
10+
[![Backers on Open Collective](https://opencollective.com/level/backers/badge.svg?color=orange)](#backers)
11+
[![Sponsors on Open Collective](https://opencollective.com/level/sponsors/badge.svg?color=orange)](#sponsors)
1112

1213
## Table of Contents
1314

@@ -24,6 +25,7 @@
2425
- [Support](#support)
2526
- [Contributing](#contributing)
2627
- [Big Thanks](#big-thanks)
28+
- [Donate](#donate)
2729
- [License](#license)
2830

2931
</details>
@@ -34,11 +36,11 @@
3436

3537
LevelDB is a simple key-value store built by Google. It's used in Google Chrome and many other products. LevelDB supports arbitrary byte arrays as both keys and values, singular _get_, _put_ and _delete_ operations, _batched put and delete_, bi-directional iterators and simple compression using the very fast [Snappy](http://google.github.io/snappy/) algorithm.
3638

37-
LevelDB stores entries sorted lexicographically by keys. This makes the [streaming interface](#createReadStream) of `levelup` - which exposes LevelDB iterators as [Readable Streams](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) - a very powerful query mechanism.
39+
LevelDB stores entries sorted lexicographically by keys. This makes the <a href="#createReadStream">streaming interface</a> of `levelup` - which exposes LevelDB iterators as [Readable Streams](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) - a very powerful query mechanism.
3840

39-
The most common store is [`leveldown`](https://github.com/level/leveldown/) which provides a pure C++ binding to LevelDB. [Many alternative stores are available](https://github.com/Level/awesome/#stores) such as [`level.js`](https://github.com/level/level.js) in the browser or [`memdown`](https://github.com/level/memdown) for an in-memory store. They typically support strings and Buffers for both keys and values. For a richer set of data types you can wrap the store with [`encoding-down`](https://github.com/level/encoding-down).
41+
The most common store is [`leveldown`](https://github.com/Level/leveldown/) which provides a pure C++ binding to LevelDB. [Many alternative stores are available](https://github.com/Level/awesome/#stores) such as [`level.js`](https://github.com/Level/level.js) in the browser or [`memdown`](https://github.com/Level/memdown) for an in-memory store. They typically support strings and Buffers for both keys and values. For a richer set of data types you can wrap the store with [`encoding-down`](https://github.com/Level/encoding-down).
4042

41-
**The [`level`](https://github.com/level/level) package is the recommended way to get started.** It conveniently bundles `levelup`, [`leveldown`](https://github.com/level/leveldown/) and [`encoding-down`](https://github.com/level/encoding-down). Its main export is `levelup` - i.e. you can do `var db = require('level')`.
43+
**The [`level`](https://github.com/Level/level) package is the recommended way to get started.** It conveniently bundles `levelup`, [`leveldown`](https://github.com/Level/leveldown/) and [`encoding-down`](https://github.com/Level/encoding-down). Its main export is `levelup` - i.e. you can do `var db = require('level')`.
4244

4345
## Supported Platforms
4446

@@ -81,20 +83,20 @@ db.put('name', 'levelup', function (err) {
8183

8284
## API
8385

84-
- [<code><b>levelup()</b></code>](#ctor)
85-
- [<code>db.<b>open()</b></code>](#open)
86-
- [<code>db.<b>close()</b></code>](#close)
87-
- [<code>db.<b>put()</b></code>](#put)
88-
- [<code>db.<b>get()</b></code>](#get)
89-
- [<code>db.<b>del()</b></code>](#del)
90-
- [<code>db.<b>batch()</b></code> _(array form)_](#batch)
91-
- [<code>db.<b>batch()</b></code> _(chained form)_](#batch_chained)
92-
- [<code>db.<b>isOpen()</b></code>](#isOpen)
93-
- [<code>db.<b>isClosed()</b></code>](#isClosed)
94-
- [<code>db.<b>createReadStream()</b></code>](#createReadStream)
95-
- [<code>db.<b>createKeyStream()</b></code>](#createKeyStream)
96-
- [<code>db.<b>createValueStream()</b></code>](#createValueStream)
97-
- [<code>db.<b>iterator()</b></code>](#iterator)
86+
- <a href="#ctor"><code><b>levelup()</b></code></a>
87+
- <a href="#open"><code>db.<b>open()</b></code></a>
88+
- <a href="#close"><code>db.<b>close()</b></code></a>
89+
- <a href="#put"><code>db.<b>put()</b></code></a>
90+
- <a href="#get"><code>db.<b>get()</b></code></a>
91+
- <a href="#del"><code>db.<b>del()</b></code></a>
92+
- <a href="#batch"><code>db.<b>batch()</b></code></a> _(array form)_
93+
- <a href="#batch_chained"><code>db.<b>batch()</b></code></a> _(chained form)_
94+
- <a href="#isOpen"><code>db.<b>isOpen()</b></code></a>
95+
- <a href="#isClosed"><code>db.<b>isClosed()</b></code></a>
96+
- <a href="#createReadStream"><code>db.<b>createReadStream()</b></code></a>
97+
- <a href="#createKeyStream"><code>db.<b>createKeyStream()</b></code></a>
98+
- <a href="#createValueStream"><code>db.<b>createValueStream()</b></code></a>
99+
- <a href="#iterator"><code>db.<b>iterator()</b></code></a>
98100

99101
### Special Notes
100102

@@ -106,7 +108,7 @@ db.put('name', 'levelup', function (err) {
106108

107109
The main entry point for creating a new `levelup` instance.
108110

109-
- `db` must be an [`abstract-leveldown`](https://github.com/level/abstract-leveldown) compliant store.
111+
- `db` must be an [`abstract-leveldown`](https://github.com/Level/abstract-leveldown) compliant store.
110112
- `options` is passed on to the underlying store when opened and is specific to the type of store being used
111113

112114
Calling `levelup(db)` will also open the underlying store. This is an asynchronous operation which will trigger your callback if you provide one. The callback should take the form `function (err, db) {}` where `db` is the `levelup` instance. If you don't provide a callback, any read & write operations are simply queued internally until the store is fully opened.
@@ -347,7 +349,7 @@ Legacy options:
347349

348350
### `db.createKeyStream([options])`
349351

350-
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of keys rather than key-value pairs. Use the same options as described for [`createReadStream`](#createReadStream) to control the range and direction.
352+
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of keys rather than key-value pairs. Use the same options as described for <a href="#createReadStream"><code>createReadStream</code></a> to control the range and direction.
351353

352354
You can also obtain this stream by passing an options object to `createReadStream()` with `keys` set to `true` and `values` set to `false`. The result is equivalent; both streams operate in [object mode](https://nodejs.org/docs/latest/api/stream.html#stream_object_mode).
353355

@@ -368,7 +370,7 @@ db.createReadStream({ keys: true, values: false })
368370

369371
### `db.createValueStream([options])`
370372

371-
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of values rather than key-value pairs. Use the same options as described for [`createReadStream`](#createReadStream) to control the range and direction.
373+
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of values rather than key-value pairs. Use the same options as described for <a href="#createReadStream"><code>createReadStream</code></a> to control the range and direction.
372374

373375
You can also obtain this stream by passing an options object to `createReadStream()` with `values` set to `true` and `keys` set to `false`. The result is equivalent; both streams operate in [object mode](https://nodejs.org/docs/latest/api/stream.html#stream_object_mode).
374376

@@ -389,17 +391,17 @@ db.createReadStream({ keys: false, values: true })
389391

390392
### `db.iterator([options])`
391393

392-
Returns an [`abstract-leveldown` iterator](https://github.com/Level/abstract-leveldown/#abstractleveldown_iteratoroptions), which is what powers the readable streams above. Options are the same as the range options of [`createReadStream()`](#createReadStream) and are passed to the underlying store.
394+
Returns an [`abstract-leveldown` iterator](https://github.com/Level/abstract-leveldown/#abstractleveldown_iteratoroptions), which is what powers the readable streams above. Options are the same as the range options of <a href="#createReadStream"><code>createReadStream</code></a> and are passed to the underlying store.
393395

394396
<a name="writeStreams"></a>
395397

396398
#### What happened to `db.createWriteStream`?
397399

398-
`db.createWriteStream()` has been removed in order to provide a smaller and more maintainable core. It primarily existed to create symmetry with `db.createReadStream()` but through much [discussion](https://github.com/level/levelup/issues/199), removing it was the best course of action.
400+
`db.createWriteStream()` has been removed in order to provide a smaller and more maintainable core. It primarily existed to create symmetry with `db.createReadStream()` but through much [discussion](https://github.com/Level/levelup/issues/199), removing it was the best course of action.
399401

400402
The main driver for this was performance. While `db.createReadStream()` performs well under most use cases, `db.createWriteStream()` was highly dependent on the application keys and values. Thus we can't provide a standard implementation and encourage more `write-stream` implementations to be created to solve the broad spectrum of use cases.
401403

402-
Check out the implementations that the community has already produced [here](https://github.com/level/levelup/wiki/Modules#write-streams).
404+
Check out the implementations that the community has already produced [here](https://github.com/Level/levelup/wiki/Modules#write-streams).
403405

404406
## Promise Support
405407

@@ -462,13 +464,13 @@ db.on('put', function (key, value) {
462464

463465
## Extending
464466

465-
A list of <a href="https://github.com/level/levelup/wiki/Modules"><b>Level modules and projects</b></a> can be found in the wiki. We are in the process of moving all this to [`awesome`](https://github.com/Level/awesome/).
467+
A list of <a href="https://github.com/Level/levelup/wiki/Modules"><b>Level modules and projects</b></a> can be found in the wiki. We are in the process of moving all this to [`awesome`](https://github.com/Level/awesome/).
466468

467469
## Multi-process Access
468470

469471
Stores like LevelDB are thread-safe but they are **not** suitable for accessing with multiple processes. You should only ever have a store open from a single Node.js process. Node.js clusters are made up of multiple processes so a `levelup` instance cannot be shared between them either.
470472

471-
See the aformentioned <a href="https://github.com/level/levelup/wiki/Modules"><b>wiki</b></a> for modules like [multilevel](https://github.com/juliangruber/multilevel), that may help if you require a single store to be shared across processes.
473+
See the aformentioned <a href="https://github.com/Level/levelup/wiki/Modules"><b>wiki</b></a> for modules like [multilevel](https://github.com/juliangruber/multilevel), that may help if you require a single store to be shared across processes.
472474

473475
## Support
474476

@@ -492,6 +494,18 @@ Cross-browser Testing Platform and Open Source ♥ Provided by [Sauce Labs](http
492494

493495
[![Sauce Labs logo](./sauce-labs.svg)](https://saucelabs.com)
494496

497+
## Donate
498+
499+
To sustain [`Level`](https://github.com/Level) and its activities, become a backer or sponsor on [Open Collective](https://opencollective.com/level). Your logo or avatar will be displayed on our 28+ [GitHub repositories](https://github.com/Level), [npm](https://www.npmjs.com/) packages and (soon) [our website](http://leveldb.org). 💖
500+
501+
### Backers
502+
503+
[![Open Collective backers](https://opencollective.com/level/backers.svg?width=890)](https://opencollective.com/level)
504+
505+
### Sponsors
506+
507+
[![Open Collective sponsors](https://opencollective.com/level/sponsors.svg?width=890)](https://opencollective.com/level)
508+
495509
## License
496510

497511
[MIT](LICENSE.md) © 2012-present [Contributors](CONTRIBUTORS.md).

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"coverage": "nyc report --reporter=text-lcov | coveralls",
1010
"test-browsers": "airtap --loopback airtap.local test/index.js",
1111
"test-browser-local": "airtap --local test/index.js",
12-
"hallmark": "hallmark --fix"
12+
"hallmark": "hallmark --fix",
13+
"dependency-check": "dependency-check . buster.js test/*.js",
14+
"prepublishOnly": "npm run dependency-check"
1315
},
1416
"dependencies": {
1517
"deferred-leveldown": "~5.0.0",
@@ -23,28 +25,25 @@
2325
"async": "^2.5.0",
2426
"bl": "^2.0.0",
2527
"browserify": "^16.0.0",
26-
"bustermove": "~1.0.0",
27-
"concat-stream": "~2.0.0",
28-
"coveralls": "~3.0.2",
29-
"delayed": "~1.0.1",
28+
"bustermove": "^1.0.0",
29+
"concat-stream": "^2.0.0",
30+
"coveralls": "^3.0.2",
31+
"delayed": "^1.0.1",
32+
"dependency-check": "^3.3.0",
3033
"encoding-down": "^6.0.0",
3134
"hallmark": "^0.1.0",
3235
"level-community": "^3.0.0",
3336
"memdown": "^3.0.0",
34-
"nyc": "~13.1.0",
35-
"pinkie": "~2.0.4",
36-
"referee": "~1.2.0",
37+
"nyc": "^13.1.0",
38+
"pinkie": "^2.0.4",
39+
"referee": "^1.2.0",
3740
"safe-buffer": "^5.1.0",
3841
"standard": "^12.0.0",
3942
"tape": "^4.7.0",
4043
"trickle": "0.0.2"
4144
},
4245
"hallmark": {
43-
"community": "level-community",
44-
"validateLinks": false,
45-
"ignore": [
46-
"README.md"
47-
]
46+
"community": "level-community"
4847
},
4948
"repository": {
5049
"type": "git",

0 commit comments

Comments
 (0)