From 66aa56d625337a205a569adc2f97d88b1ca5f071 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 6 Jan 2019 18:39:38 +0100 Subject: [PATCH 1/8] Add dependency-check --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 453f9109..81f93834 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "coverage": "nyc report --reporter=text-lcov | coveralls", "test-browsers": "airtap --loopback airtap.local test/index.js", "test-browser-local": "airtap --local test/index.js", - "hallmark": "hallmark --fix" + "hallmark": "hallmark --fix", + "dependency-check": "dependency-check . buster.js test/*.js", + "prepublishOnly": "npm run dependency-check" }, "dependencies": { "deferred-leveldown": "~5.0.0", @@ -27,6 +29,7 @@ "concat-stream": "~2.0.0", "coveralls": "~3.0.2", "delayed": "~1.0.1", + "dependency-check": "^3.3.0", "encoding-down": "^6.0.0", "hallmark": "^0.1.0", "level-community": "^3.0.0", From 973f33cbfcbb3fe7776eddc18e8b1d6c716d3f79 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 6 Jan 2019 18:39:51 +0100 Subject: [PATCH 2/8] Add Donate section and badges to README.md --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f84aa28b..65a5be3e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # levelup [![level badge][level-badge]](https://github.com/level/awesome) -[![npm](https://img.shields.io/npm/v/levelup.svg)](https://www.npmjs.com/package/levelup) -![Node version](https://img.shields.io/node/v/levelup.svg) +[![npm](https://img.shields.io/npm/v/levelup.svg?label=&logo=npm)](https://www.npmjs.com/package/levelup) +[![Node version](https://img.shields.io/node/v/levelup.svg)](https://www.npmjs.com/package/levelup) [![Build Status](https://secure.travis-ci.org/Level/levelup.svg?branch=master)](http://travis-ci.org/Level/levelup) [![dependencies](https://david-dm.org/Level/levelup.svg)](https://david-dm.org/level/levelup) -[![npm](https://img.shields.io/npm/dm/levelup.svg)](https://www.npmjs.com/package/levelup) +[![npm](https://img.shields.io/npm/dm/levelup.svg?label=dl)](https://www.npmjs.com/package/levelup) [![Coverage Status](https://coveralls.io/repos/github/Level/levelup/badge.svg)](https://coveralls.io/github/Level/levelup) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) +[![Backers on Open Collective](https://opencollective.com/level/backers/badge.svg?color=orange)](#backers) +[![Sponsors on Open Collective](https://opencollective.com/level/sponsors/badge.svg?color=orange)](#sponsors) ## Table of Contents @@ -492,6 +494,18 @@ Cross-browser Testing Platform and Open Source ♥ Provided by [Sauce Labs](http [![Sauce Labs logo](./sauce-labs.svg)](https://saucelabs.com) +## Donate + +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). 💖 + +### Backers + +[![Open Collective backers](https://opencollective.com/level/backers.svg?width=890)](https://opencollective.com/level) + +### Sponsors + +[![Open Collective sponsors](https://opencollective.com/level/sponsors.svg?width=890)](https://opencollective.com/level) + ## License [MIT](LICENSE.md) © 2012-present [Contributors](CONTRIBUTORS.md). From 696185af4f0f8d30c124aa9110fba6e413f7b464 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 6 Jan 2019 18:39:51 +0100 Subject: [PATCH 3/8] Unlock 7 devDependencies --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 81f93834..a870596d 100644 --- a/package.json +++ b/package.json @@ -25,18 +25,18 @@ "async": "^2.5.0", "bl": "^2.0.0", "browserify": "^16.0.0", - "bustermove": "~1.0.0", - "concat-stream": "~2.0.0", - "coveralls": "~3.0.2", - "delayed": "~1.0.1", + "bustermove": "^1.0.0", + "concat-stream": "^2.0.0", + "coveralls": "^3.0.2", + "delayed": "^1.0.1", "dependency-check": "^3.3.0", "encoding-down": "^6.0.0", "hallmark": "^0.1.0", "level-community": "^3.0.0", "memdown": "^3.0.0", - "nyc": "~13.1.0", - "pinkie": "~2.0.4", - "referee": "~1.2.0", + "nyc": "^13.1.0", + "pinkie": "^2.0.4", + "referee": "^1.2.0", "safe-buffer": "^5.1.0", "standard": "^12.0.0", "tape": "^4.7.0", From cce673e72962684b7ec845047f4a0aceb588f9f3 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 6 Jan 2019 18:40:07 +0100 Subject: [PATCH 4/8] Run hallmark --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ed1a6964..81b92f78 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -5,8 +5,8 @@ | **Lars-Magnus Skog** | [**@ralphtheninja**](https://github.com/ralphtheninja) | [**@ralph@social.weho.st**](https://social.weho.st/@ralph) | | **Rod Vagg** | [**@rvagg**](https://github.com/rvagg) | [**@rvagg@twitter**](https://twitter.com/rvagg) | | **Julian Gruber** | [**@juliangruber**](https://github.com/juliangruber) | [**@juliangruber@twitter**](https://twitter.com/juliangruber) | -| **Vincent Weevers** | [**@vweevers**](https://github.com/vweevers) | [**@vweevers@twitter**](https://twitter.com/vweevers) | | **Dominic Tarr** | [**@dominictarr**](https://github.com/dominictarr) | [**@dominictarr@twitter**](https://twitter.com/dominictarr) | +| **Vincent Weevers** | [**@vweevers**](https://github.com/vweevers) | [**@vweevers@twitter**](https://twitter.com/vweevers) | | **Matteo Collina** | [**@mcollina**](https://github.com/mcollina) | [**@matteocollina@twitter**](https://twitter.com/matteocollina) | | **James Halliday** | [**@substack**](https://github.com/substack) | [**@substack@twitter**](https://twitter.com/substack) | | **David Björklund** | [**@kesla**](https://github.com/kesla) | [**@david_bjorklund@twitter**](https://twitter.com/david_bjorklund) | From dac9edabfdf5adc4ba80fab0c8602329134311de Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 6 Jan 2019 20:02:53 +0100 Subject: [PATCH 5/8] Tweak badges and links in README.md --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 65a5be3e..2b40fde7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # levelup -[![level badge][level-badge]](https://github.com/level/awesome) +[![level badge][level-badge]](https://github.com/Level/awesome) [![npm](https://img.shields.io/npm/v/levelup.svg?label=&logo=npm)](https://www.npmjs.com/package/levelup) [![Node version](https://img.shields.io/node/v/levelup.svg)](https://www.npmjs.com/package/levelup) -[![Build Status](https://secure.travis-ci.org/Level/levelup.svg?branch=master)](http://travis-ci.org/Level/levelup) -[![dependencies](https://david-dm.org/Level/levelup.svg)](https://david-dm.org/level/levelup) +[![Travis](https://img.shields.io/travis/Level/levelup.svg?logo=travis&label=)](https://travis-ci.org/Level/levelup) [![npm](https://img.shields.io/npm/dm/levelup.svg?label=dl)](https://www.npmjs.com/package/levelup) [![Coverage Status](https://coveralls.io/repos/github/Level/levelup/badge.svg)](https://coveralls.io/github/Level/levelup) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) @@ -38,9 +37,9 @@ LevelDB is a simple key-value store built by Google. It's used in Google Chrome 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. -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). +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). -**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')`. +**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')`. ## Supported Platforms @@ -108,7 +107,7 @@ db.put('name', 'levelup', function (err) { The main entry point for creating a new `levelup` instance. -- `db` must be an [`abstract-leveldown`](https://github.com/level/abstract-leveldown) compliant store. +- `db` must be an [`abstract-leveldown`](https://github.com/Level/abstract-leveldown) compliant store. - `options` is passed on to the underlying store when opened and is specific to the type of store being used 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. @@ -397,11 +396,11 @@ Returns an [`abstract-leveldown` iterator](https://github.com/Level/abstract-lev #### What happened to `db.createWriteStream`? -`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. +`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. 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. -Check out the implementations that the community has already produced [here](https://github.com/level/levelup/wiki/Modules#write-streams). +Check out the implementations that the community has already produced [here](https://github.com/Level/levelup/wiki/Modules#write-streams). ## Promise Support @@ -464,13 +463,13 @@ db.on('put', function (key, value) { ## Extending -A list of Level modules and projects can be found in the wiki. We are in the process of moving all this to [`awesome`](https://github.com/Level/awesome/). +A list of Level modules and projects can be found in the wiki. We are in the process of moving all this to [`awesome`](https://github.com/Level/awesome/). ## Multi-process Access 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. -See the aformentioned wiki for modules like [multilevel](https://github.com/juliangruber/multilevel), that may help if you require a single store to be shared across processes. +See the aformentioned wiki for modules like [multilevel](https://github.com/juliangruber/multilevel), that may help if you require a single store to be shared across processes. ## Support From 0f79934c0ed7063d9c065ab615ae0e85d91d99fc Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Mon, 7 Jan 2019 00:24:18 +0100 Subject: [PATCH 6/8] Fix 'Link to unknown heading(s)' in README.md --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2b40fde7..07f9919c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ 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. -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. +LevelDB stores entries sorted lexicographically by keys. This makes the streaming interface 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. 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). @@ -82,20 +82,20 @@ db.put('name', 'levelup', function (err) { ## API -- [levelup()](#ctor) -- [db.open()](#open) -- [db.close()](#close) -- [db.put()](#put) -- [db.get()](#get) -- [db.del()](#del) -- [db.batch() _(array form)_](#batch) -- [db.batch() _(chained form)_](#batch_chained) -- [db.isOpen()](#isOpen) -- [db.isClosed()](#isClosed) -- [db.createReadStream()](#createReadStream) -- [db.createKeyStream()](#createKeyStream) -- [db.createValueStream()](#createValueStream) -- [db.iterator()](#iterator) +- levelup() +- db.open() +- db.close() +- db.put() +- db.get() +- db.del() +- db.batch() _(array form)_ +- db.batch() _(chained form)_ +- db.isOpen() +- db.isClosed() +- db.createReadStream() +- db.createKeyStream() +- db.createValueStream() +- db.iterator() ### Special Notes @@ -348,7 +348,7 @@ Legacy options: ### `db.createKeyStream([options])` -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. +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 to control the range and direction. 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). @@ -369,7 +369,7 @@ db.createReadStream({ keys: true, values: false }) ### `db.createValueStream([options])` -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. +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 to control the range and direction. 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). @@ -390,7 +390,7 @@ db.createReadStream({ keys: false, values: true }) ### `db.iterator([options])` -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. +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 and are passed to the underlying store. From 6bb263de28514e3946d350648f1e795d6d4d018b Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Mon, 7 Jan 2019 00:24:46 +0100 Subject: [PATCH 7/8] Remove README.md from hallmark ignore option --- package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/package.json b/package.json index a870596d..f935849b 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,7 @@ "trickle": "0.0.2" }, "hallmark": { - "community": "level-community", - "validateLinks": false, - "ignore": [ - "README.md" - ] + "community": "level-community" }, "repository": { "type": "git", From a4f24ec34ca7aff655c4c4520d168bf6ca993018 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Mon, 7 Jan 2019 00:25:41 +0100 Subject: [PATCH 8/8] Run hallmark --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 07f9919c..8b41ce69 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ - [Support](#support) - [Contributing](#contributing) - [Big Thanks](#big-thanks) +- [Donate](#donate) - [License](#license)