diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b74ffca..941f1dd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,7 @@ updates: ignore: - dependency-name: dependency-check - dependency-name: standard + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c3a5d38 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [8, 10, 12, 14] + name: Node ${{ matrix.node }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use node ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Install + run: npm install + - name: Test + run: npm test + - name: Coverage + run: npm run coverage + - name: Codecov + uses: codecov/codecov-action@v2 + with: + file: coverage/lcov.info diff --git a/.gitignore b/.gitignore index 3cd96ab..9950b3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .nyc_output/ +coverage diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 422684e..0000000 --- a/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.nyc_output/ -.travis.yml diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 07092b9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - 8 - - 10 - - 12 - -after_success: npm run coverage - -notifications: - email: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c9d0bf..5cdc9aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog -_**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ - ## [4.0.0] - 2019-06-08 +_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._ + ### Changed - Upgrade `level-packager` from `^4.0.0` to `^5.0.1` ([`1033aa8`](https://github.com/Level/level-rocksdb/commit/1033aa8)) ([#59](https://github.com/Level/level-rocksdb/issues/59)) ([**@vweevers**](https://github.com/vweevers)) @@ -45,6 +45,8 @@ _**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ ## [3.0.0] - 2018-05-24 +_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._ + ### Changed - Upgrade `rocksdb` to `^3.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja)) @@ -62,6 +64,8 @@ _**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ ## [2.0.0] - 2018-04-17 +_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._ + ### Changed - Upgrade `rocksdb` to `^2.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja)) @@ -87,16 +91,18 @@ _**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ - Update links in README ([**@mcollina**](https://github.com/mcollina)) -## 1.0.0 - 2017-07-01 +## [1.0.0] - 2017-07-01 + +_Technically not the first release. Earlier versions were published in 2013._ -**Historical Note** Technically not the first release. Earlier versions were published in 2013. +[4.0.0]: https://github.com/Level/level-rocksdb/releases/tag/v4.0.0 -[4.0.0]: https://github.com/Level/level-rocksdb/compare/v3.0.1...v4.0.0 +[3.0.1]: https://github.com/Level/level-rocksdb/releases/tag/v3.0.1 -[3.0.1]: https://github.com/Level/level-rocksdb/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/Level/level-rocksdb/releases/tag/v3.0.0 -[3.0.0]: https://github.com/Level/level-rocksdb/compare/v2.0.0...v3.0.0 +[2.0.0]: https://github.com/Level/level-rocksdb/releases/tag/v2.0.0 -[2.0.0]: https://github.com/Level/level-rocksdb/compare/v1.0.1...v2.0.0 +[1.0.1]: https://github.com/Level/level-rocksdb/releases/tag/v1.0.1 -[1.0.1]: https://github.com/Level/level-rocksdb/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/Level/level-rocksdb/releases/tag/v1.0.0 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index d2ad727..0000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,8 +0,0 @@ -# Contributors - -| Name | GitHub | Social | -| :------------------- | :----------------------------------------------------- | :-------------------------------------------------------------- | -| **Vincent Weevers** | [**@vweevers**](https://github.com/vweevers) | [**@vweevers@twitter**](https://twitter.com/vweevers) | -| **Lars-Magnus Skog** | [**@ralphtheninja**](https://github.com/ralphtheninja) | [**@ralph@social.weho.st**](https://social.weho.st/@ralph) | -| **Matteo Collina** | [**@mcollina**](https://github.com/mcollina) | [**@matteocollina@twitter**](https://twitter.com/matteocollina) | -| **Rod Vagg** | [**@rvagg**](https://github.com/rvagg) | [**@rvagg@twitter**](https://twitter.com/rvagg) | diff --git a/LICENSE.md b/LICENSE similarity index 92% rename from LICENSE.md rename to LICENSE index 7dd1735..f158a2a 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,6 +1,6 @@ -# The MIT License (MIT) +The MIT License (MIT) -**Copyright © 2013-present [Contributors](CONTRIBUTORS.md).** +Copyright © 2013 The contributors to level-rocksdb. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b062c50..7cec61c 100644 --- a/README.md +++ b/README.md @@ -3,40 +3,34 @@ > Fast & simple storage. A Node.js-style RocksDB wrapper. [![level badge][level-badge]](https://github.com/Level/awesome) -[![npm](https://img.shields.io/npm/v/level-rocksdb.svg?label=&logo=npm)](https://www.npmjs.com/package/level-rocksdb) +[![npm](https://img.shields.io/npm/v/level-rocksdb.svg)](https://www.npmjs.com/package/level-rocksdb) [![Node version](https://img.shields.io/node/v/level-rocksdb.svg)](https://www.npmjs.com/package/level-rocksdb) -[![Travis](https://img.shields.io/travis/com/Level/level-rocksdb.svg?logo=travis&label=)](https://travis-ci.com/Level/level-rocksdb) -[![npm](https://img.shields.io/npm/dm/level-rocksdb.svg?label=dl)](https://www.npmjs.com/package/level-rocksdb) -[![Coverage Status](https://coveralls.io/repos/github/Level/level-rocksdb/badge.svg)](https://coveralls.io/github/Level/level-rocksdb) -[![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) +[![Test](https://img.shields.io/github/workflow/status/Level/level-rocksdb/Test?label=test)](https://github.com/Level/level-rocksdb/actions/workflows/test.yml) +[![Coverage](https://img.shields.io/codecov/c/github/Level/level-rocksdb?label=&logo=codecov&logoColor=fff)](https://codecov.io/gh/Level/level-rocksdb) +[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com) +[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org) +[![Donate](https://img.shields.io/badge/donate-orange?logo=open-collective&logoColor=fff)](https://opencollective.com/level) -A convenience package that: +## Introduction -* exports a function that returns a [`levelup instance`](https://github.com/Level/levelup#ctor) when invoked -* bundles the current release of [`levelup`][levelup] and [`rocksdb`][rocksdb] -* leverages encodings using [`encoding-down`][encoding-down] +This is a convenience package that: + +- exports a function that returns a [`levelup instance`](https://github.com/Level/levelup#ctor) when invoked +- bundles the current release of [`levelup`][levelup] and [`rocksdb`][rocksdb] +- leverages encodings using [`encoding-down`][encoding-down] Use this package to avoid having to explicitly install `rocksdb` when you want to use RocksDB with `levelup`. See also [`level`][level] which does the same for LevelDB. -* [Usage](#usage) -* [API](#api) -* [Promise Support](#promise-support) -* [Events](#events) -* [Contributing](#contributing) -* [License](#license) +## Usage **If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md). -## Usage - ```js -var level = require('level-rocksdb') +const level = require('level-rocksdb') // 1) Create our database, supply location and options. // This will create or open the underlying RocksDB store. -var db = level('./mydb') +const db = level('./mydb') // 2) Put a key & value db.put('name', 'Level', function (err) { @@ -52,6 +46,13 @@ db.put('name', 'Level', function (err) { }) ``` +With `async/await`: + +```js +await db.put('name', 'Level') +const value = await db.get('name') +``` + ## API * [<code><b>level()</b></code>](#ctor) @@ -413,19 +414,11 @@ See the [Contribution Guide](https://github.com/Level/community/blob/master/CONT ## 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) and [npm](https://www.npmjs.com/) packages. 💖 - -### 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) +Support us with a monthly donation on [Open Collective](https://opencollective.com/level) and help us continue our work. ## License -[MIT](LICENSE.md) © 2013-present [Contributors](CONTRIBUTORS.md). +[MIT](LICENSE) [level-badge]: https://leveljs.org/img/badge.svg [levelup]: https://github.com/Level/levelup diff --git a/UPGRADING.md b/UPGRADING.md index 2b88937..37f5e1d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -2,10 +2,10 @@ This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the [changelog](CHANGELOG.md). -## v4 +## 4.0.0 Upgraded to [`rocksdb@4.0.0`](https://github.com/Level/rocksdb/blob/master/UPGRADING.md#v4) and (through `level-packager@5`) [`levelup@4`](https://github.com/Level/levelup/blob/master/UPGRADING.md#v4) and [`encoding-down@6`](https://github.com/Level/encoding-down/blob/master/UPGRADING.md#v6). Please follow these links for more information. A quick summary: support of node < 8.6.0 has been dropped, node 12 is now supported, range options (e.g. `gt`) are now serialized the same as keys, `{ gt: undefined }` is not the same as `{}`, nullish values are now rejected and streams are backed by [`readable-stream@3`](https://github.com/nodejs/readable-stream#version-3xx). -## v3 +## 3.0.0 Dropped support for node 4. No other breaking changes. diff --git a/package.json b/package.json index 6a02e98..b1db1e0 100644 --- a/package.json +++ b/package.json @@ -6,26 +6,28 @@ "main": "level-rocksdb.js", "scripts": { "test": "standard && hallmark && nyc node test.js", - "coverage": "nyc report --reporter=text-lcov | coveralls", + "coverage": "nyc report -r lcovonly", "hallmark": "hallmark --fix", "dependency-check": "dependency-check . test.js", "prepublishOnly": "npm run dependency-check" }, + "files": [ + "level-rocksdb.js", + "CHANGELOG.md", + "UPGRADING.md" + ], "dependencies": { "level-packager": "^6.0.0", "rocksdb": "^4.0.0" }, "devDependencies": { - "coveralls": "^3.0.2", "dependency-check": "^3.3.0", "hallmark": "^3.1.0", - "level-community": "^3.0.0", "nyc": "^15.0.0", "standard": "^14.0.0", "tape": "^5.0.1" }, "hallmark": { - "community": "level-community", "ignore": [ "README.md" ]