Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynos committed Dec 13, 2012
1 parent e11f4a5 commit c798a51
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ Delete a range of keys in leveldb

## Example

```js
var level = require("levelidb")
, after = require("after")
, toArray = require("write-stream/array")
, db = level("/tmp/delete-range-simple", {
createIfMissing: true
})
, deleteRange = require("level-delete-range")

var next = after(3, function () {
deleteRange(db, {
start: "foo:"
, end: "foo;"
}, function (err) {
db.readStream()
.pipe(toArray(function (list) {
console.log("list", list)
}))
})
})

db.put("foo:1", { foo: "1" }, next)
db.put("foo:2", { foo: "2" }, next)
db.put("foo:3", { foo: "3" }, next)
```

## Installation

`npm install level-delete-range`
Expand All @@ -12,4 +38,4 @@ Delete a range of keys in leveldb

- Raynos

## MIT Licenced
## MIT Licenced

0 comments on commit c798a51

Please sign in to comment.