[Pkg-javascript-commits] [node-leveldown] 23/492: minor readme tweaks
Andrew Kelley
andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:41 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 579e29dabdf88ad0934018035d8b2a2f7b6d23e8
Author: Rod Vagg <rod at vagg.org>
Date: Fri Aug 17 22:00:09 2012 +1000
minor readme tweaks
---
README.md | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index f54ae89..fcd0cba 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,12 @@
-LevelUP — Fast & simple storage; a Node.js-style LevelDB wrapper
-======================================================================
+LevelUP
+=======
+
+Fast & simple storage; a Node.js-style LevelDB wrapper
+------------------------------------------------------
**[LevelDB](http://code.google.com/p/leveldb/)** is a simple key/value data store built by Google, inspired by BigTable. It's used in Google Chrome and many other products. LevelDB supports arbitrary byte arrays as both keys and values, singular *get*, *put* and *delete* operations, *batched put and delete*, forward and reverse iteration and simple compression using the [Snappy](http://code.google.com/p/snappy/) algorithm which is optimised for speed over compression.
+
**LevelUP** aims to expose the features of LevelDB in a Node.js-friendly way. Both keys and values are treated as `Buffer` objects and are automatically converted using a specified `'encoding'`. LevelDB's iterators are exposed as a Node.js style object-`ReadStream` and writing can be peformed via an object-`WriteStream`.
Basic usage
@@ -38,18 +42,16 @@ db.open(function (err) {
### Options
-`createDatabase()` takes an optional options object as its second argument.
-
-`createIfMissing` *(boolean)*: If `true`, will initialise an empty database at the specified location if one doesn't already exit. If `false` and a database doesn't exist you will receive an error in your `open()` callback and your database won't open.
-
-`errorIfExists` *(boolean)*: If `true`, you will receive an error in your `open()` callback if the database exists at the specified location.
+`createDatabase()` takes an optional options object as its second argument; the following properties are accepted:
-`encoding` *(string)*:
+* `createIfMissing` *(boolean)*: If `true`, will initialise an empty database at the specified location if one doesn't already exit. If `false` and a database doesn't exist you will receive an error in your `open()` callback and your database won't open.
- The encoding of the keys and values passed through Node.js' `Buffer` implementation (see `[Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end))
+* `errorIfExists` *(boolean)*: If `true`, you will receive an error in your `open()` callback if the database exists at the specified location.
- `'utf8'` is the default encoding for both keys and values so you can simply pass in strings and expect strings from your `get()` operations. You can also pass `Buffer` objects as keys and/or values and converstion will be performed.
+* `encoding` *(string)*: The encoding of the keys and values passed through Node.js' `Buffer` implementation (see `[Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end)`)
+ <p>`'utf8'` is the default encoding for both keys and values so you can simply pass in strings and expect strings from your `get()` operations. You can also pass `Buffer` objects as keys and/or values and converstion will be performed.</p>
+ <p>Supported encodings are: hex, utf8, ascii, binary, base64, ucs2, utf16le.</p>
+ <p>**json** encoding will be supported in a future release, likely stored as utf8 strings.</p>
- Supported encodings are: hex, utf8, ascii, binary, base64, ucs2, utf16le
+* `keyEncoding` and `valueEncoding` *(string)*: use instead of `encoding` to specify the exact encoding of both the keys and the values in this database.
- **json** encoding will be supported in a future release, likely stored as utf8 strings.
\ No newline at end of file
--
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