# changesdown

> levelup that uses a leveldown that writes to a changes feed to store its state

Latest version **2.3.1** (published 2015-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install changesdown
pnpm add changesdown
yarn add changesdown
bun add changesdown
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.1 |
| Published | 2015-03-07 |
| First published | 2015-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/changesdown
- Repository: https://github.com/mafintosh/changesdown
- Issues: https://github.com/mafintosh/changesdown/issues
- npm.io page: https://npm.io/package/changesdown

## Dependencies (7)

- [brfs](https://npm.io/package/brfs.md) ^1.4.0
- [pump](https://npm.io/package/pump.md) ^1.0.0
- [levelup](https://npm.io/package/levelup.md) ^0.19.0
- [through2](https://npm.io/package/through2.md) ^0.6.3
- [subleveldown](https://npm.io/package/subleveldown.md) ^1.1.0
- [protocol-buffers](https://npm.io/package/protocol-buffers.md) ^2.4.6
- [abstract-leveldown](https://npm.io/package/abstract-leveldown.md) ^2.1.0

## Recent versions

- 2.3.1 (latest) — 2015-03-07
- 2.3.0 — 2015-03-04
- 2.2.2 — 2015-01-31
- 2.2.1 — 2015-01-30
- 2.2.0 — 2015-01-16
- 2.1.0 — 2015-01-16
- 2.0.0 — 2015-01-16
- 1.0.1 — 2015-01-16
- 1.0.0 — 2015-01-15

## README

# changesdown

levelup that uses a leveldown that writes to a changes feed to store its state

```
npm install changesdown
```

[![build status](http://img.shields.io/travis/mafintosh/changesdown.svg?style=flat)](http://travis-ci.org/mafintosh/changesdown)

## Usage

``` js
var changesdown = require('changesdown')
var changes = require('changes-feed')
var level = require('level')

var feed = changes(level('changes'))
var db = changesdown(level('db'), feed)

db.put('hello', 'world', function() {
  db.get('hello', function(err, value) {
    console.log(value) // should print world
  })
})

db.createChangesStream({live:true})
  .on('data', function(data) {
    console.log('change:', data.value) // should print some changes
  })
```

## API

#### `db = changesdown(levelup, changesFeed, [options])`

Returns a new levelup (`db`) that reads and writes from the changes feed.
The levelup you pass in is used to store a view of the feed.

Any options passed will be forwarded to the levelup constructor.

#### `stream = db.createChangesStream(opts)`

Read from the changes stream and decode the changes value
with the same encoding that was used in the levelup.

For example if you pass `{valueEncoding: 'json'}` the values
will be decoded as JSON instead of buffers

## License

MIT

---
_Source: https://npm.io/package/changesdown · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
