Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use full link references in readme #60

Merged
merged 1 commit into from
Jun 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding-down

> An [`abstract-leveldown`] implementation that wraps another store to encode keys and values.
> 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)](https://www.npmjs.com/package/encoding-down)
Expand All @@ -12,9 +12,9 @@

## Introduction

Stores like [`leveldown`] can only store strings and Buffers. For a richer set of data types you can wrap such a store with `encoding-down`. It allows you to specify an _encoding_ to use for keys and values independently. This not only widens the range of input types, but also limits the range of output types. The encoding is applied to all read and write operations: it encodes writes and decodes reads.
Stores like [`leveldown`][leveldown] can only store strings and Buffers. For a richer set of data types you can wrap such a store with `encoding-down`. It allows you to specify an _encoding_ to use for keys and values independently. This not only widens the range of input types, but also limits the range of output types. The encoding is applied to all read and write operations: it encodes writes and decodes reads.

[Many encodings are builtin][builtin-encodings] courtesy of [`level-codec`]. The default encoding is `utf8` which ensures you'll always get back a string. You can also provide a custom encoding like `bytewise` - [or your own](#custom-encodings)!
[Many encodings are builtin][builtin-encodings] courtesy of [`level-codec`][level-codec]. The default encoding is `utf8` which ensures you'll always get back a string. You can also provide a custom encoding like `bytewise` - [or your own](#custom-encodings)!

## Usage

Expand Down Expand Up @@ -98,9 +98,9 @@ db.put(Buffer.from([0, 255]), 'example', function (err) {
})
```

## Usage with [`level`]
## Usage with [`level`][level]

The [`level`] module conveniently bundles `encoding-down` and passes its `options` to `encoding-down`. This means you can simply do:
The [`level`][level] module conveniently bundles `encoding-down` and passes its `options` to `encoding-down`. This means you can simply do:

```js
const level = require('level')
Expand All @@ -118,8 +118,8 @@ db.put('example', 42, function (err) {

### `const db = require('encoding-down')(db[, options])`

- `db` must be an [`abstract-leveldown`] compliant store
- `options` are passed to [`level-codec`]:
- `db` must be an [`abstract-leveldown`][abstract-leveldown] compliant store
- `options` are passed to [`level-codec`][level-codec]:
- `keyEncoding`: encoding to use for keys
- `valueEncoding`: encoding to use for values

Expand Down Expand Up @@ -170,13 +170,13 @@ const db = level('./db8', {

[level-badge]: http://leveldb.org/img/badge.svg

[`abstract-leveldown`]: https://github.com/level/abstract-leveldown
[abstract-leveldown]: https://github.com/level/abstract-leveldown

[`leveldown`]: https://github.com/level/leveldown
[leveldown]: https://github.com/level/leveldown

[`level`]: https://github.com/level/level
[level]: https://github.com/level/level

[`level-codec`]: https://github.com/level/codec
[level-codec]: https://github.com/level/codec

[builtin-encodings]: https://github.com/level/codec#builtin-encodings

Expand Down