Skip to content

Commit

Permalink
Update README (#27)
Browse files Browse the repository at this point in the history
* Remove Greenkeeper badge

* Example -> Usage

* Tweak API

* Remove Publishers header

* Tweak License

* Add level badge

* Travis badge as svg

* Add npm badge

* Add node badge

* Add dependencies badge

* Add standard badge

* Add downloads badge
  • Loading branch information
ralphtheninja authored and vweevers committed Jun 10, 2018
1 parent 3089e2c commit 0b4d52b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- 10
- 9
- 8
- 6
- 8
- 9
- 10
8 changes: 3 additions & 5 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
The MIT License (MIT)
=====================
# The MIT License (MIT)

Copyright (c) 2012-2017 LevelUP contributors
---------------------------------------
## Copyright (c) 2012-present `level-iterator-stream` contributors

*LevelUP contributors listed at <https://github.com/rvagg/node-levelup#contributors>*
*`level-iterator-stream` contributors listed at <https://github.com/level/community#contributors>*

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@

# level-iterator-stream

<img alt="LevelDB Logo" height="100" src="http://leveldb.org/img/logo.svg">

> Turn a leveldown iterator into a readable stream
[![Build Status](https://travis-ci.org/Level/iterator-stream.png)](https://travis-ci.org/Level/iterator-stream) [![Greenkeeper badge](https://badges.greenkeeper.io/Level/iterator-stream.svg)](https://greenkeeper.io/)
[![level badge][level-badge]](https://github.com/level/awesome)
[![npm](https://img.shields.io/npm/v/level-iterator-stream.svg)](https://www.npmjs.com/package/level-iterator-stream)
![Node version](https://img.shields.io/node/v/level-iterator-stream.svg)
[![Build Status](https://img.shields.io/travis/Level/iterator-stream.svg)](https://travis-ci.org/Level/iterator-stream)
[![dependencies](https://david-dm.org/Level/iterator-stream.svg)](https://david-dm.org/level/iterator-stream)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![npm](https://img.shields.io/npm/dm/level-iterator-stream.svg)](https://www.npmjs.com/package/level-iterator-stream)

## Example
## Usage

```js
const iteratorStream = require('level-iterator-stream')
const leveldown = require('leveldown')
var iteratorStream = require('level-iterator-stream')
var leveldown = require('leveldown')

const db = leveldown(__dirname + '/db')
var db = leveldown(__dirname + '/db')
db.open(function (err) {
if (err) throw err

const stream = iteratorStream(db.iterator())
var stream = iteratorStream(db.iterator())
stream.on('data', function (kv) {
console.log('%s -> %s', kv.key, kv.value)
})
Expand All @@ -32,26 +35,20 @@ $ npm install level-iterator-stream

## API

### iteratorStream(iterator[, options])

Create a readable stream from `iterator`. `options` are passed down to the
`require('readable-stream').Readable` constructor, with `objectMode` forced
to `true`.
### `stream = iteratorStream(iterator[, options])`

Set `options.keys` or `options.values` to `false` to only get values / keys. Otherwise receive `{ key, value }` objects.
Create a readable stream from `iterator`. `options` are passed down to the `require('readable-stream').Readable` constructor, with `objectMode` forced to `true`.

When the stream ends, the `iterator` will be closed and afterwards a
`"close"` event emitted.
Set `options.keys` or `options.values` to `false` to only get values / keys. Otherwise receive `{ key, value }` objects.

`.destroy()` will force close the underlying iterator.
When the stream ends, the `iterator` will be closed and afterwards a `"close"` event emitted.

## Publishers
`.destroy()` will force close the underlying iterator.

* [@juliangruber](https://github.com/juliangruber)
* [@ralphtheninja](https://github.com/ralphtheninja)
## License

## License &amp; copyright
Copyright &copy; 2012-present `level-iterator-stream` contributors.

Copyright (c) 2012-2017 LevelUP contributors.
`level-iterator-stream` is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included `LICENSE.md` file for more details.

LevelUP is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
[level-badge]: http://leveldb.org/img/badge.svg
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"tape": "^4.4.0",
"through2": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"license": "MIT"
}

0 comments on commit 0b4d52b

Please sign in to comment.