[Pkg-javascript-commits] [node-leveldown] 63/492: document events

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.

commit bc7f26630fb709a862eda687f4925d106e43662b
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Sat Nov 17 01:39:01 2012 -0800

    document events
---
 README.md | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index fac805e..fbfd4dd 100644
--- a/README.md
+++ b/README.md
@@ -193,6 +193,21 @@ The ReadStream is also [fstream](https://github.com/isaacs/fstream)-compatible w
 
 KeyStreams and ValueStreams can be treated like standard streams of raw data. If `'encoding'` is set to `'binary'` the `'data'` events will simply be standard Node `Buffer` objects straight out of the data store.
 
+
+Events
+------
+
+Levelup emits events when the callbacks to the corrisponding methods are called.
+
+* `db.emit('put', key, value)` emitted when a new value is `'put'`,
+* `db.emit('del', key)` emitted when a value is deleted,
+* `db.emit('batch', ary)` emitted when a batch opperation has executed.
+* `db.emit('ready')` emitted when the database has opened.
+* `db.emit('closed')` emitted when the database has closed.
+
+If you do not pass a callback to an async function, and there is an error,
+levelup will `emit('error', err)` instead.
+
 JSON
 ----
 
@@ -214,4 +229,5 @@ Licence & copyright
 
 LevelUP is Copyright (c) 2012 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
 
-LevelUP builds on the excellent work of the LevelDB and Snappy teams from Google and additional contributors. LevelDB and Snappy are both issued under the [New BSD Licence](http://opensource.org/licenses/BSD-3-Clause).
\ No newline at end of file
+LevelUP builds on the excellent work of the LevelDB and Snappy teams from Google and additional contributors. LevelDB and Snappy are both issued under the [New BSD Licence](http://opensource.org/licenses/BSD-3-Clause).
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-leveldown.git



More information about the Pkg-javascript-commits mailing list