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

Commit

Permalink
Update metadata and add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Sep 30, 2021
1 parent 4038a30 commit 9ec82f7
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 89 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release
on:
push:
tags: ['*']
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create GitHub release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86 changes: 48 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [7.0.0] - 2021-04-09

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._

### Changed

- **Breaking:** drop node 6 and 8 ([Level/community#98](https://github.com/Level/community/issues/98)) ([`5c6752f`](https://github.com/Level/encoding-down/commit/5c6752f)) (Vincent Weevers)
Expand Down Expand Up @@ -70,6 +72,8 @@

## [6.0.0] - 2018-12-25

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._

### Changed

- Prefer `const` over `var` in README ([**@ralphtheninja**](https://github.com/ralphtheninja))
Expand Down Expand Up @@ -120,6 +124,8 @@

## [5.0.0] - 2018-05-13

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._

### Added

- Add 10 to Travis ([**@ralphtheninja**](https://github.com/ralphtheninja))
Expand All @@ -141,6 +147,8 @@

## [4.0.0] - 2018-02-12

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._

### Added

- Add 9 to Travis ([**@ralphtheninja**](https://github.com/ralphtheninja))
Expand All @@ -166,6 +174,8 @@

## [3.0.0] - 2017-11-11

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._

### Added

- README: add node badge (>= 4) ([**@vweevers**](https://github.com/vweevers))
Expand Down Expand Up @@ -336,78 +346,78 @@

:seedling: Initial release.

[7.0.0]: https://github.com/Level/encoding-down/compare/v6.3.0...v7.0.0
[7.0.0]: https://github.com/Level/encoding-down/releases/tag/v7.0.0

[6.3.0]: https://github.com/Level/encoding-down/compare/v6.2.0...v6.3.0
[6.3.0]: https://github.com/Level/encoding-down/releases/tag/v6.3.0

[6.2.0]: https://github.com/Level/encoding-down/compare/v6.1.0...v6.2.0
[6.2.0]: https://github.com/Level/encoding-down/releases/tag/v6.2.0

[6.1.0]: https://github.com/Level/encoding-down/compare/v6.0.2...v6.1.0
[6.1.0]: https://github.com/Level/encoding-down/releases/tag/v6.1.0

[6.0.2]: https://github.com/Level/encoding-down/compare/v6.0.1...v6.0.2
[6.0.2]: https://github.com/Level/encoding-down/releases/tag/v6.0.2

[6.0.1]: https://github.com/Level/encoding-down/compare/v6.0.0...v6.0.1
[6.0.1]: https://github.com/Level/encoding-down/releases/tag/v6.0.1

[6.0.0]: https://github.com/Level/encoding-down/compare/v5.0.4...v6.0.0
[6.0.0]: https://github.com/Level/encoding-down/releases/tag/v6.0.0

[5.0.4]: https://github.com/Level/encoding-down/compare/v5.0.3...v5.0.4
[5.0.4]: https://github.com/Level/encoding-down/releases/tag/v5.0.4

[5.0.3]: https://github.com/Level/encoding-down/compare/v5.0.2...v5.0.3
[5.0.3]: https://github.com/Level/encoding-down/releases/tag/v5.0.3

[5.0.2]: https://github.com/Level/encoding-down/compare/v5.0.1...v5.0.2
[5.0.2]: https://github.com/Level/encoding-down/releases/tag/v5.0.2

[5.0.1]: https://github.com/Level/encoding-down/compare/v5.0.0...v5.0.1
[5.0.1]: https://github.com/Level/encoding-down/releases/tag/v5.0.1

[5.0.0]: https://github.com/Level/encoding-down/compare/v4.0.1...v5.0.0
[5.0.0]: https://github.com/Level/encoding-down/releases/tag/v5.0.0

[4.0.1]: https://github.com/Level/encoding-down/compare/v4.0.0...v4.0.1
[4.0.1]: https://github.com/Level/encoding-down/releases/tag/v4.0.1

[4.0.0]: https://github.com/Level/encoding-down/compare/v3.0.1...v4.0.0
[4.0.0]: https://github.com/Level/encoding-down/releases/tag/v4.0.0

[3.0.1]: https://github.com/Level/encoding-down/compare/v3.0.0...v3.0.1
[3.0.1]: https://github.com/Level/encoding-down/releases/tag/v3.0.1

[3.0.0]: https://github.com/Level/encoding-down/compare/v2.3.4...v3.0.0
[3.0.0]: https://github.com/Level/encoding-down/releases/tag/v3.0.0

[2.3.4]: https://github.com/Level/encoding-down/compare/v2.3.3...v2.3.4
[2.3.4]: https://github.com/Level/encoding-down/releases/tag/v2.3.4

[2.3.3]: https://github.com/Level/encoding-down/compare/v2.3.2...v2.3.3
[2.3.3]: https://github.com/Level/encoding-down/releases/tag/v2.3.3

[2.3.2]: https://github.com/Level/encoding-down/compare/v2.3.1...v2.3.2
[2.3.2]: https://github.com/Level/encoding-down/releases/tag/v2.3.2

[2.3.1]: https://github.com/Level/encoding-down/compare/v2.3.0...v2.3.1
[2.3.1]: https://github.com/Level/encoding-down/releases/tag/v2.3.1

[2.3.0]: https://github.com/Level/encoding-down/compare/v2.2.1...v2.3.0
[2.3.0]: https://github.com/Level/encoding-down/releases/tag/v2.3.0

[2.2.1]: https://github.com/Level/encoding-down/compare/v2.2.0...v2.2.1
[2.2.1]: https://github.com/Level/encoding-down/releases/tag/v2.2.1

[2.2.0]: https://github.com/Level/encoding-down/compare/v2.1.5...v2.2.0
[2.2.0]: https://github.com/Level/encoding-down/releases/tag/v2.2.0

[2.1.5]: https://github.com/Level/encoding-down/compare/v2.1.4...v2.1.5
[2.1.5]: https://github.com/Level/encoding-down/releases/tag/v2.1.5

[2.1.4]: https://github.com/Level/encoding-down/compare/v2.1.3...v2.1.4
[2.1.4]: https://github.com/Level/encoding-down/releases/tag/v2.1.4

[2.1.3]: https://github.com/Level/encoding-down/compare/v2.1.2...v2.1.3
[2.1.3]: https://github.com/Level/encoding-down/releases/tag/v2.1.3

[2.1.2]: https://github.com/Level/encoding-down/compare/v2.1.1...v2.1.2
[2.1.2]: https://github.com/Level/encoding-down/releases/tag/v2.1.2

[2.1.1]: https://github.com/Level/encoding-down/compare/v2.1.0...v2.1.1
[2.1.1]: https://github.com/Level/encoding-down/releases/tag/v2.1.1

[2.1.0]: https://github.com/Level/encoding-down/compare/v2.0.8...v2.1.0
[2.1.0]: https://github.com/Level/encoding-down/releases/tag/v2.1.0

[2.0.8]: https://github.com/Level/encoding-down/compare/v2.0.7...v2.0.8
[2.0.8]: https://github.com/Level/encoding-down/releases/tag/v2.0.8

[2.0.7]: https://github.com/Level/encoding-down/compare/v2.0.6...v2.0.7
[2.0.7]: https://github.com/Level/encoding-down/releases/tag/v2.0.7

[2.0.6]: https://github.com/Level/encoding-down/compare/v2.0.5...v2.0.6
[2.0.6]: https://github.com/Level/encoding-down/releases/tag/v2.0.6

[2.0.5]: https://github.com/Level/encoding-down/compare/v2.0.4...v2.0.5
[2.0.5]: https://github.com/Level/encoding-down/releases/tag/v2.0.5

[2.0.4]: https://github.com/Level/encoding-down/compare/v2.0.3...v2.0.4
[2.0.4]: https://github.com/Level/encoding-down/releases/tag/v2.0.4

[2.0.3]: https://github.com/Level/encoding-down/compare/v2.0.2...v2.0.3
[2.0.3]: https://github.com/Level/encoding-down/releases/tag/v2.0.3

[2.0.2]: https://github.com/Level/encoding-down/compare/v2.0.1...v2.0.2
[2.0.2]: https://github.com/Level/encoding-down/releases/tag/v2.0.2

[2.0.1]: https://github.com/Level/encoding-down/compare/v2.0.0...v2.0.1
[2.0.1]: https://github.com/Level/encoding-down/releases/tag/v2.0.1

[2.0.0]: https://github.com/Level/encoding-down/compare/v1.0.0...v2.0.0
[2.0.0]: https://github.com/Level/encoding-down/releases/tag/v2.0.0
9 changes: 0 additions & 9 deletions CONTRIBUTORS.md

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)
The MIT License (MIT)

**Copyright © 2012-present [Contributors](CONTRIBUTORS.md).**
Copyright © 2012 The contributors to encoding-down.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
59 changes: 25 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
> An [`abstract-leveldown`][abstract-leveldown] implementation that wraps another store to encode keys and values.
[![level badge][level-badge]](https://github.com/Level/awesome)
[![npm](https://img.shields.io/npm/v/encoding-down.svg?label=&logo=npm)](https://www.npmjs.com/package/encoding-down)
[![npm](https://img.shields.io/npm/v/encoding-down.svg)](https://www.npmjs.com/package/encoding-down)
[![Node version](https://img.shields.io/node/v/encoding-down.svg)](https://www.npmjs.com/package/encoding-down)
[![Test](https://github.com/Level/encoding-down/actions/workflows/test.yml/badge.svg)](https://github.com/Level/encoding-down/actions/workflows/test.yml)
[![Coverage Status](https://codecov.io/gh/Level/encoding-down/branch/master/graph/badge.svg)](https://codecov.io/gh/Level/encoding-down)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![npm](https://img.shields.io/npm/dm/encoding-down.svg?label=dl)](https://www.npmjs.com/package/encoding-down)
[![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/encoding-down/Test?label=test)](https://github.com/Level/encoding-down/actions/workflows/test.yml)
[![Coverage](https://img.shields.io/codecov/c/github/Level/encoding-down?label=&logo=codecov&logoColor=fff)](https://codecov.io/gh/Level/encoding-down)
[![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)

## Introduction

Expand All @@ -23,11 +22,11 @@ Stores like [`leveldown`][leveldown] can only store strings and Buffers. Other t
Without any options, `encoding-down` defaults to the `utf8` encoding.

```js
var levelup = require('levelup')
var leveldown = require('leveldown')
var encode = require('encoding-down')
const levelup = require('levelup')
const leveldown = require('leveldown')
const encode = require('encoding-down')

var db = levelup(encode(leveldown('./db1')))
const db = levelup(encode(leveldown('./db1')))

db.put('example', Buffer.from('encoding-down'), function (err) {
db.get('example', function (err, value) {
Expand All @@ -39,7 +38,7 @@ db.put('example', Buffer.from('encoding-down'), function (err) {
Can we store objects? Yes!

```js
var db = levelup(encode(leveldown('./db2'), { valueEncoding: 'json' }))
const db = levelup(encode(leveldown('./db2'), { valueEncoding: 'json' }))

db.put('example', { awesome: true }, function (err) {
db.get('example', function (err, value) {
Expand All @@ -52,7 +51,7 @@ db.put('example', { awesome: true }, function (err) {
How about storing Buffers, but getting back a hex-encoded string?

```js
var db = levelup(encode(leveldown('./db3'), { valueEncoding: 'hex' }))
const db = levelup(encode(leveldown('./db3'), { valueEncoding: 'hex' }))

db.put('example', Buffer.from([0, 255]), function (err) {
db.get('example', function (err, value) {
Expand All @@ -64,7 +63,7 @@ db.put('example', Buffer.from([0, 255]), function (err) {
What if we previously stored binary data?

```js
var db = levelup(encode(leveldown('./db4'), { valueEncoding: 'binary' }))
const db = levelup(encode(leveldown('./db4'), { valueEncoding: 'binary' }))

db.put('example', Buffer.from([0, 255]), function (err) {
db.get('example', function (err, value) {
Expand All @@ -81,7 +80,7 @@ db.put('example', Buffer.from([0, 255]), function (err) {
And what about keys?

```js
var db = levelup(encode(leveldown('./db5'), { keyEncoding: 'json' }))
const db = levelup(encode(leveldown('./db5'), { keyEncoding: 'json' }))

db.put({ awesome: true }, 'example', function (err) {
db.get({ awesome: true }, function (err, value) {
Expand All @@ -91,7 +90,7 @@ db.put({ awesome: true }, 'example', function (err) {
```

```js
var db = levelup(encode(leveldown('./db6'), { keyEncoding: 'binary' }))
const db = levelup(encode(leveldown('./db6'), { keyEncoding: 'binary' }))

db.put(Buffer.from([0, 255]), 'example', function (err) {
db.get('00ff', { keyEncoding: 'hex' }, function (err, value) {
Expand All @@ -105,8 +104,8 @@ db.put(Buffer.from([0, 255]), 'example', function (err) {
The [`level`][level] module conveniently bundles `encoding-down` and passes its `options` to `encoding-down`. This means you can simply do:

```js
var level = require('level')
var db = level('./db7', { valueEncoding: 'json' })
const level = require('level')
const db = level('./db7', { valueEncoding: 'json' })

db.put('example', 42, function (err) {
db.get('example', function (err, value) {
Expand All @@ -132,11 +131,11 @@ Both encodings default to `'utf8'`. They can be a string (builtin `level-codec`
Please refer to [`level-codec` documentation][encoding-format] for a precise description of the format. Here's a quick example with `level` and `async/await` just for fun:

```js
var level = require('level')
var lexint = require('lexicographic-integer')
const level = require('level')
const lexint = require('lexicographic-integer')

async function main () {
var db = level('./db8', {
const db = level('./db8', {
keyEncoding: {
type: 'lexicographic-integer',
encode: (n) => lexint.pack(n, 'hex'),
Expand All @@ -158,10 +157,10 @@ main()
With an npm-installed encoding (modularity ftw!) we can reduce the above to:

```js
var level = require('level')
var lexint = require('lexicographic-integer-encoding')('hex')
const level = require('level')
const lexint = require('lexicographic-integer-encoding')('hex')

var db = level('./db8', {
const db = level('./db8', {
keyEncoding: lexint
})
```
Expand All @@ -176,19 +175,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) © 2012-present [Contributors](CONTRIBUTORS.md).
[MIT](LICENSE)

[level-badge]: https://leveljs.org/img/badge.svg

Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"files": [
"index.js",
"CHANGELOG.md",
"CONTRIBUTORS.md",
"LICENSE.md",
"UPGRADING.md"
],
"dependencies": {
Expand All @@ -30,15 +28,11 @@
"airtap-playwright": "^1.0.1",
"dependency-check": "^3.3.0",
"hallmark": "^3.1.0",
"level-community": "^3.0.0",
"memdown": "^6.1.0",
"nyc": "^15.1.0",
"standard": "^16.0.3",
"tape": "^5.0.1"
},
"hallmark": {
"community": "level-community"
},
"repository": "Level/encoding-down",
"homepage": "https://github.com/Level/encoding-down",
"keywords": [
Expand Down

0 comments on commit 9ec82f7

Please sign in to comment.