Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junosuarez/node-level-export
export a level-db database to a JSON stream
https://github.com/junosuarez/node-level-export
Last synced: 8 days ago
JSON representation
export a level-db database to a JSON stream
- Host: GitHub
- URL: https://github.com/junosuarez/node-level-export
- Owner: junosuarez
- License: isc
- Created: 2014-05-22T19:41:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-23T16:23:11.000Z (over 10 years ago)
- Last Synced: 2024-04-09T23:08:40.986Z (7 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# level-export
export a level-db database to a JSON streamsee also: [level-import](https://npm.im/level-import)
## usage
```js
var levelExport = require('level-export')levelExport(levelUPdb)
.pipe(process.stdout)
```
outputs
```console
[
{"key":"a","value":"o"},
{"key":"b","value":"m"},
{"key":"c","value":"g"}
]
```## api
### `levelExport(db: Object, opt: Object) => ReadableStream`
Creates a readable JSON stream from a LevelUP database instance. This stream is suitable for dumping to a file for backup purposes.
`opt` can have the following options:
- `start` : string. start of export key range
- `end` : string. end of export key range## installation
$ npm install level-export
## running the tests
From package root:
$ npm install
$ npm test## prior art
- [level-to-json](https://github.com/kesla/level-to-json) - returns the whole db as a single JavaScript object. `level-export` uses a streaming interface instead and outputs JSON-serialized strings suitable for piping to a file or other destination.
## contributors
- jden
## license
ISC. (c) MMXIV jden . See LICENSE.md