Skip to content

Commit

Permalink
Document behavior of pending operations on close
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Apr 28, 2019
1 parent 4f5c9cc commit 687a6a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ The following options are for advanced performance tuning. Modify them only if y

<code>close()</code> is an instance method on an existing database object. The underlying LevelDB database will be closed and the `callback` function will be called with no arguments if the operation is successful or with a single `error` argument if the operation failed for any reason.

`leveldown` waits for any pending operations to finish before closing. For example:

```js
db.put('key', 'value', function (err) {
// This happens first
})

db.close(function (err) {
// This happens second
})
```

<a name="leveldown_put"></a>

### `db.put(key, value[, options], callback)`
Expand Down

0 comments on commit 687a6a1

Please sign in to comment.