[Pkg-javascript-commits] [node-leveldown] 166/492: remove LevelUP components

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:55 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 8faa18b9c9fe43992f8d490c9a2bed1b5c7a93ab
Author: Rod Vagg <rod at vagg.org>
Date:   Sun Jan 6 22:52:42 2013 +1100

    remove LevelUP components
---
 README.md                                          | 400 +------------
 index.js                                           |   1 +
 lib/errors.js                                      |  18 -
 lib/levelup.js                                     | 381 -------------
 lib/read-stream.js                                 | 159 ------
 lib/util.js                                        |  50 --
 lib/write-stream.js                                | 152 -----
 package.json                                       |  27 +-
 test/benchmarks/README.md                          |  42 --
 test/benchmarks/engines/index.js                   |  19 -
 test/benchmarks/engines/leveled.js                 |  21 -
 test/benchmarks/engines/levelup-nosnappy.js        |  21 -
 test/benchmarks/engines/levelup-release.js         |  21 -
 test/benchmarks/engines/levelup.js                 |  21 -
 test/benchmarks/engines/sqlite3.js                 |  26 -
 test/benchmarks/index.js                           |  97 ----
 test/benchmarks/package.json                       |  16 -
 .../tests/batch_int_string_x100000_leveled.js      |   1 -
 .../tests/batch_int_string_x100000_levelup.js      |   1 -
 .../tests/batch_int_string_x1000_leveled.js        |  20 -
 .../tests/batch_int_string_x1000_levelup.js        |  21 -
 .../tests/get_int_string_x1000_leveled.js          |  14 -
 .../tests/get_int_string_x1000_levelup.js          |  29 -
 .../tests/get_int_string_x1000_sqlite3.js          |  33 --
 .../benchmarks/tests/get_int_string_x10_leveled.js |   2 -
 .../benchmarks/tests/get_int_string_x10_levelup.js |   2 -
 .../benchmarks/tests/get_int_string_x10_sqlite3.js |   2 -
 test/benchmarks/tests/index.js                     |  64 ---
 .../tests/put_int_string_x100000_leveled.js        |   1 -
 .../tests/put_int_string_x100000_levelup.js        |   1 -
 .../tests/put_int_string_x100000_sqlite3.js        |   1 -
 .../tests/put_int_string_x1000_leveled.js          |   1 -
 .../tests/put_int_string_x1000_levelup.js          |  20 -
 .../tests/put_int_string_x1000_sqlite3.js          |  22 -
 .../benchmarks/tests/put_int_string_x10_leveled.js |   1 -
 .../benchmarks/tests/put_int_string_x10_levelup.js |   1 -
 .../benchmarks/tests/put_int_string_x10_sqlite3.js |   1 -
 test/binary-test.js                                | 167 ------
 test/compression-test.js                           |  88 ---
 test/copy-test.js                                  |  66 ---
 test/data/testdata.bin                             | Bin 4688 -> 0 bytes
 test/deferred-open-test.js                         | 126 ----
 test/functional/binary-data-test.js                |  43 --
 test/functional/compat-test.js                     |  50 --
 test/functional/fstream-test.js                    | 102 ----
 test/functional/tarcommon.js                       |  97 ----
 test/functional/test-data.db.tar                   | Bin 3153920 -> 0 bytes
 test/functional/test-data.tar                      | Bin 2273280 -> 0 bytes
 test/idempotent-test.js                            |  55 --
 test/json-test.js                                  |  88 ---
 test/key-value-streams-test.js                     | 120 ----
 test/read-stream-test.js                           | 633 ---------------------
 test/simple-test.js                                | 561 ------------------
 test/snapshot-test.js                              |  66 ---
 test/write-stream-test.js                          | 206 -------
 55 files changed, 17 insertions(+), 4161 deletions(-)

diff --git a/README.md b/README.md
index f92da98..b00a86b 100644
--- a/README.md
+++ b/README.md
@@ -1,402 +1,22 @@
-LevelUP
-=======
+LevelDOWN
+=========
 
-Fast & simple storage - a Node.js-style LevelDB wrapper
--------------------------------------------------------
-
-[![Build Status](https://secure.travis-ci.org/rvagg/node-levelup.png)](http://travis-ci.org/rvagg/node-levelup)
-
-**[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`.
-
-An important feature of LevelDB is that it stores entries sorted by keys. This makes LevelUP's <a href="#readStream"><code>ReadStream</code></a> interface is a very powerful way to look up items, particularly when combined with the `start` option.
-
-**LevelUP** is an **OPEN Open Source Project**, see the <a href="#contributing">Contributing</a> section to find out what this means.
-
-  * <a href="#platforms">Tested & supported platforms</a>
-  * <a href="#basic">Basic usage</a>
-  * <a href="#api">API</a>
-  * <a href="#events">Events</a>
-  * <a href="#json">JSON data</a>
-  * <a href="#considerations">Important considerations</a>
-  * <a href="#contributing">Contributing</a>
-  * <a href="#licence">Licence & copyright</a>
-
-See also a list of <a href="https://github.com/rvagg/node-levelup/wiki/Modules"><b>Node.js LevelDB modules and projects</b></a> in the wiki.
-
-<a name="platforms"></a>
-Tested & supported platforms
-----------------------------
-
-  * **Linux** (tested on Ubuntu)
-  * **Mac OS**
-  * **Solaris** (tested on SmartOS & Nodejitsu)
-
-**Windows** support is coming soon; see [issue #5](https://github.com/rvagg/node-levelup/issues/5) if you would like to help on that front. 
-
-<a name="basic"></a>
-Basic usage
------------
-
-All operations are asynchronous although they don't necessarily require a callback if you don't need to know when the operation was performed.
-
-```js
-var levelup = require('levelup')
-
-// 1) Create our database, supply location and options.
-//    This will create or open the underlying LevelDB store.
-var db = levelup('./mydb')
-
-// 2) put a key & value
-db.put('name', 'LevelUP', function (err) {
-  if (err) return console.log('Ooops!', err) // some kind of I/O error
-
-  // 3) fetch by key
-  db.get('name', function (err, value) {
-    if (err) return console.log('Ooops!', err) // likely the key was not found
-
-    // ta da!
-    console.log('name=' + value)
-  })
-})
-```
-
-<a name="api"></a>
-## API
-
-  * <a href="#ctor"><code><b>levelup()</b></code></a>
-  * <a href="#open"><code>db.<b>open()</b></code></a>
-  * <a href="#close"><code>db.<b>close()</b></code></a>
-  * <a href="#put"><code>db.<b>put()</b></code></a>
-  * <a href="#get"><code>db.<b>get()</b></code></a>
-  * <a href="#del"><code>db.<b>del()</b></code></a>
-  * <a href="#batch"><code>db.<b>batch()</b></code></a>
-  * <a href="#approximateSize"><code>db.<b>approximateSize()</b></code></a>
-  * <a href="#isOpen"><code>db.<b>isOpen()</b></code></a>
-  * <a href="#isClosed"><code>db.<b>isClosed()</b></code></a>
-  * <a href="#readStream"><code>db.<b>readStream()</b></code></a>
-  * <a href="#keyStream"><code>db.<b>keyStream()</b></code></a>
-  * <a href="#valueStream"><code>db.<b>valueStream()</b></code></a>
-  * <a href="#writeStream"><code>db.<b>writeStream()</b></code></a>
-
-
---------------------------------------------------------
-<a name="ctor"></a>
-### levelup(location[, options[, callback]])
-<code>levelup()</code> is the main entry point for creating a new LevelUP instance and opening the underlying store with LevelDB.
-
-This function returns a new instance of LevelUP and will also initiate an <a href="#open"><code>open()</code></a> operation. Opening the database is an asynchronous operation which will trigger your callback if you provide one. The callback should take the form: `function (err, db) {}` where the `db` is the LevelUP instance. If you don't provide a callback, any read & write operations are simply queued internally until the database is fully opened.
-
-This leads to two alternative ways of managing a new LevelUP instance:
-
-```js
-levelup(location, options, function (err, db) {
-  if (err) throw err
-  db.get('foo', function (err, value) {
-    if (err) return console.log('foo does not exist')
-    console.log('got foo =', value)
-  })
-})
-
-// vs the equivalent:
-
-var db = levelup(location, options) // will throw if an error occurs
-db.get('foo', function (err, value) {
-  if (err) return console.log('foo does not exist')
-  console.log('got foo =', value)
-})
-```
-
-#### `options`
-
-`levelup()` takes an optional options object as its second argument; the following properties are accepted:
-
-* `'createIfMissing'` *(boolean, default: `true`)*: If `true`, will initialise an empty database at the specified location if one doesn't already exist. 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, default: `false`)*: If `true`, you will receive an error in your `open()` callback if the database exists at the specified location.
-
-* `'compression'` *(boolean, default: `true`)*: If `true`, all *compressible* data will be run through the Snappy compression algorithm before being stored. Snappy is very fast and shouldn't gain much speed by disabling so leave this on unless you have good reason to turn it off.
-
-* `'cacheSize'` *(number, default: `8 * 1024 * 1024`)*: The size (in bytes) of the in-memory [LRU](http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used) cache with frequently used uncompressed block contents. 
-
-* `'encoding'` *(string, default: `'utf8'`)*: 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><code>'utf8'</code> is the default encoding for both keys and values so you can simply pass in strings and expect strings from your <code>get()</code> operations. You can also pass <code>Buffer</code> objects as keys and/or values and conversion will be performed.</p>
-  <p>Supported encodings are: hex, utf8, ascii, binary, base64, ucs2, utf16le.</p>
-  <p><code>'json'</code> encoding is also supported, see below.</p>
-
-* `'keyEncoding'` and `'valueEncoding'` *(string, default: `'utf8'`)*: use instead of `encoding` to specify the exact encoding of both the keys and the values in this database.
-
-Additionally, each of the main interface methods accept an optional options object that can be used to override `encoding` (or `keyEncoding` & `valueEncoding`).
-
---------------------------------------------------------
-<a name="open"></a>
-### db.open([callback])
-<code>open()</code> opens the underlying LevelDB store. In general **you should never need to call this method directly** as it's automatically called by <a href="#ctor"><code>levelup()</code></a>.
-
-However, it is possible to *reopen* a database after it has been closed with <a href="#close"><code>close()</code></a>, although this is not generally advised.
-
---------------------------------------------------------
-<a name="close"></a>
-### db.close([callback])
-<code>close()</code> closes the underlying LevelDB store. The callback will receive any error encountered during closing as the first argument.
-
-You should always clean up your LevelUP instance by calling `close()` when you no longer need it to free up resources. A LevelDB store cannot be opened by multiple instances of LevelDB/LevelUP simultaneously.
-
---------------------------------------------------------
-<a name="put"></a>
-### db.put(key, value[, options][, callback])
-<code>put()</code> is the primary method for inserting data into the store. Both the `key` and `value` can be arbitrary data objects.
-
-The callback argument is optional but if you don't provide one and an error occurs then expect the error to be thrown.
-
-#### `options`
-
-Encoding of the `key` and `value` objects will adhere to `encoding` option(s) provided to <a href="#ctor"><code>levelup()</code></a>, although you can provide alternative encoding settings in the options for `put()` (it's recommended that you stay consistent in your encoding of keys and values in a single store).
-
-If you provide a `'sync'` value of `true` in your `options` object, LevelDB will perform a synchronous write of the data; although the operation will be asynchronous as far as Node is concerned. Normally, LevelDB passes the data to the operating system for writing and returns immediately, however a synchronous write will use `fsync()` or equivalent so your callback won't be triggered until the data is actually on disk. Synchronous filesystem writes are **significantly** slower than async [...]
-
---------------------------------------------------------
-<a name="get"></a>
-### db.get(key[, options][, callback])
-<code>get()</code> is the primary method for fetching data from the store. The `key` can be an arbitrary data object but if it doesn't exist in the store then the callback will receive an error as its first argument.
-
-#### `options`
-
-Encoding of the `key` objects will adhere to `encoding` option(s) provided to <a href="#ctor"><code>levelup()</code></a>, although you can provide alternative encoding settings in the options for `get()` (it's recommended that you stay consistent in your encoding of keys and values in a single store).
-
-LevelDB will by default fill the in-memory LRU Cache with data from a call to get. Disabling this is done by setting `fillCache` to `false`. 
-
---------------------------------------------------------
-<a name="del"></a>
-### db.del(key[, options][, callback])
-<code>del()</code> is the primary method for removing data from the store. The `key` can be an arbitrary data object but if it doesn't exist in the store then the callback will receive an error as its first argument.
-
-#### `options`
-
-Encoding of the `key` objects will adhere to `encoding` option(s) provided to <a href="#ctor"><code>levelup()</code></a>, although you can provide alternative encoding settings in the options for `del()` (it's recommended that you stay consistent in your encoding of keys and values in a single store).
-
-A `'sync'` option can also be passed, see <a href="#put"><code>put()</code></a> for details on how this works.
-
---------------------------------------------------------
-<a name="batch"></a>
-### db.batch(array[, options][, callback])
-<code>batch()</code> can be used for very fast bulk-write operations (both *put* and *delete*). The `array` argument should contain a list of operations to be executed sequentially. Each operation is contained in an object having the following properties: `type`, `key`, `value`, where the *type* is either `'put'` or `'del'`. In the case of `'del'` the `'value'` property is ignored.
-
-```js
-var ops = [
-    { type: 'del', key: 'father' }
-  , { type: 'put', key: 'name', value: 'Yuri Irsenovich Kim' }
-  , { type: 'put', key: 'dob', value: '16 February 1941' }
-  , { type: 'put', key: 'spouse', value: 'Kim Young-sook' }
-  , { type: 'put', key: 'occupation', value: 'Clown' }
-]
-
-db.batch(ops, function (err) {
-  if (err) return console.log('Ooops!', err)
-  console.log('Great success dear leader!')
-})
-```
-
-
-#### `options`
-
-See <a href="#put"><code>put()</code></a> for a discussion on the `options` object. You can overwrite default `key` and `value` encodings and also specify the use of `sync` filesystem operations.
-
---------------------------------------------------------
-<a name='approximateSize'></a>
-### db.approximateSize(start, end, callback)
-<code>approximateSize()</code> can used to get the approximate number of bytes of file system space used by the range `[start..end)`. The result may not include recently written data.
-
-```js
-db.approximateSize('a', 'c', function (err, size) {
-  if (err) return console.error('Ooops!', err)
-  console.log('Approximate size of range is %d', size)
-})
-```
-
---------------------------------------------------------
-<a name="isOpen"></a>
-### db.isOpen()
-
-A LevelUP object can be in one of the following states:
-
-  * *"new"*     - newly created, not opened or closed
-  * *"opening"* - waiting for the database to be opened
-  * *"open"*    - successfully opened the database, available for use
-  * *"closing"* - waiting for the database to be closed
-  * *"closed"*  - database has been successfully closed, should not be used
-
-`isOpen()` will return `true` only when the state is "open".
-
---------------------------------------------------------
-<a name="isClosed"></a>
-### db.isClosed()
-
-*See <a href="#put"><code>isOpen()</code></a>*
-
-`isClosed()` will return `true` only when the state is "closing" *or* "closed", it can be useful for determining if read and write operations are permissible.
-
---------------------------------------------------------
-<a name="readStream"></a>
-### db.readStream([options])
-
-You can obtain a **ReadStream** of the full database by calling the `readStream()` method. The resulting stream is a complete Node.js-style [Readable Stream](http://nodejs.org/docs/latest/api/stream.html#stream_readable_stream) where `'data'` events emit objects with `'key'` and `'value'` pairs.
-
-```js
-db.readStream()
-  .on('data', function (data) {
-    console.log(data.key, '=', data.value)
-  })
-  .on('error', function (err) {
-    console.log('Oh my!', err)
-  })
-  .on('close', function () {
-    console.log('Stream closed')
-  })
-  .on('end', function () {
-    console.log('Stream closed')
-  })
-```
-
-The standard `pause()`, `resume()` and `destroy()` methods are implemented on the ReadStream, as is `pipe()` (see below). `'data'`, '`error'`, `'end'` and `'close'` events are emitted.
-
-Additionally, you can supply an options object as the first parameter to `readStream()` with the following options:
-
-* `'start'`: the key you wish to start the read at. By default it will start at the beginning of the store. Note that the *start* doesn't have to be an actual key that exists, LevelDB will simply find the *next* key, greater than the key you provide.
-
-* `'end'`: the key you wish to end the read on. By default it will continue until the end of the store. Again, the *end* doesn't have to be an actual key as an (inclusive) `<=`-type operation is performed to detect the end. You can also use the `destroy()` method instead of supplying an `'end'` parameter to achieve the same effect.
-
-* `'reverse'` *(boolean, default: `false`)*: a boolean, set to true if you want the stream to go in reverse order. Beware that due to the way LevelDB works, a reverse seek will be slower than a forward seek.
-
-* `'keys'` *(boolean, default: `true`)*: whether the `'data'` event should contain keys. If set to `true` and `'values'` set to `false` then `'data'` events will simply be keys, rather than objects with a `'key'` property. Used internally by the `keyStream()` method.
-
-* `'values'` *(boolean, default: `true`)*: whether the `'data'` event should contain values. If set to `true` and `'keys'` set to `false` then `'data'` events will simply be values, rather than objects with a `'value'` property. Used internally by the `valueStream()` method.
-
-* `'limit'` *(number, default: `-1`)*: limit the number of results collected by this stream. This number represents a *maximum* number of results and may not be reached if you get to the end of the store or your `'end'` value first. A value of `-1` means there is no limit.
-
-* `'fillCache'` *(boolean, default: `false`)*: wheather LevelDB's LRU-cache should be filled with data read.
-
---------------------------------------------------------
-<a name="keyStream"></a>
-### db.keyStream([options])
-
-A **KeyStream** is a **ReadStream** where the `'data'` events are simply the keys from the database so it can be used like a traditional stream rather than an object stream.
-
-You can obtain a KeyStream either by calling the `keyStream()` method on a LevelUP object or by passing passing an options object to `readStream()` with `keys` set to `true` and `values` set to `false`.
-
-```js
-db.keyStream()
-  .on('data', function (data) {
-    console.log('key=', data)
-  })
-
-// same as:
-db.readStream({ keys: true, values: false })
-  .on('data', function (data) {
-    console.log('key=', data)
-  })
-```
-
---------------------------------------------------------
-<a name="valueStream"></a>
-### db.valueStream([options])
-
-A **ValueStream** is a **ReadStream** where the `'data'` events are simply the values from the database so it can be used like a traditional stream rather than an object stream.
-
-You can obtain a ValueStream either by calling the `valueStream()` method on a LevelUP object or by passing passing an options object to `readStream()` with `values` set to `true` and `keys` set to `false`.
-
-```js
-db.valueStream()
-  .on('data', function (data) {
-    console.log('value=', data)
-  })
-
-// same as:
-db.readStream({ keys: false, values: true })
-  .on('data', function (data) {
-    console.log('value=', data)
-  })
-```
-
---------------------------------------------------------
-<a name="writeStream"></a>
-### db.writeStream([options])
-
-A **WriteStream** can be obtained by calling the `writeStream()` method. The resulting stream is a complete Node.js-style [Writable Stream](http://nodejs.org/docs/latest/api/stream.html#stream_writable_stream) which accepts objects with `'key'` and `'value'` pairs on its `write()` method. The WriteStream will buffer writes and submit them as a `batch()` operation where the writes occur on the same event loop tick, otherwise they are treated as simple `put()` operations.
-
-```js
-db.writeStream()
-  .on('error', function (err) {
-    console.log('Oh my!', err)
-  })
-  .on('close', function () {
-    console.log('Stream closed')
-  })
-  .write({ key: 'name', value: 'Yuri Irsenovich Kim' })
-  .write({ key: 'dob', value: '16 February 1941' })
-  .write({ key: 'spouse', value: 'Kim Young-sook' })
-  .write({ key: 'occupation', value: 'Clown' })
-  .end()
-```
-
-The standard `write()`, `end()`, `destroy()` and `destroySoon()` methods are implemented on the WriteStream. `'drain'`, `'error'`, `'close'` and `'pipe'` events are emitted.
-
-#### Pipes and Node Stream compatibility
-
-A ReadStream can be piped directly to a WriteStream, allowing for easy copying of an entire database. A simple `copy()` operation is included in LevelUP that performs exactly this on two open databases:
-
-```js
-function copy (srcdb, dstdb, callback) {
-  srcdb.readStream().pipe(dstdb.writeStream()).on('close', callback)
-}
-```
-
-The ReadStream is also [fstream](https://github.com/isaacs/fstream)-compatible which means you should be able to pipe to and from fstreams. So you can serialize and deserialize an entire database to a directory where keys are filenames and values are their contents, or even into a *tar* file using [node-tar](https://github.com/isaacs/node-tar). See the [fstream functional test](https://github.com/rvagg/node-levelup/blob/master/test/functional/fstream-test.js) for an example. *(Note: I'm  [...]
-
-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.
-
-<a name="events"></a>
-Events
-------
-
-LevelUP emits events when the callbacks to the corresponding 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 operation has executed
-* `db.emit('ready')` emitted when the database has opened (`'open'` is synonym)
-* `db.emit('closed')` emitted when the database has closed
-* `db.emit('opening')` emitted when the database is opening
-* `db.emit('closing')` emitted when the database is closing
-
-If you do not pass a callback to an async function, and there is an error, LevelUP will `emit('error', err)` instead.
-
-<a name="json"></a>
-JSON data
----------
-
-You specify `'json'` encoding for both keys and/or values, you can then supply JavaScript objects to LevelUP and receive them from all fetch operations, including ReadStreams. LevelUP will automatically *stringify* your objects and store them as *utf8* and parse the strings back into objects before passing them back to you.
-
-<a name="considerations"></a>
-Important considerations
-------------------------
-
-* LevelDB is thread-safe but is **not** suitable for accessing with multiple processes. You should only ever have a LevelDB database open from a single Node.js process.
+A Node.js LevelDB binding (currently being extracted from LevelUP)
+-------------------------
 
 <a name="contributing"></a>
 Contributing
 ------------
 
-LevelUP is an **OPEN Open Source Project**. This means that:
+LevelDOWN is an **OPEN Open Source Project**. This means that:
 
 > Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
 
-See the [CONTRIBUTING.md](https://github.com/rvagg/node-levelup/blob/master/CONTRIBUTING.md) file for more details.
+See the [CONTRIBUTING.md](https://github.com/rvagg/node-leveldown/blob/master/CONTRIBUTING.md) file for more details.
 
 ### Contributors
 
-LevelUP is only possible due to the excellent work of the following contributors:
+LevelDOWN is only possible due to the excellent work of the following contributors:
 
 <table><tbody>
 <tr><th align="left">Rod Vagg</th><td><a href="https://github.com/rvagg">GitHub/rvagg</a></td><td><a href="http://twitter.com/rvagg">Twitter/@rvagg</a></td></tr>
@@ -414,8 +34,8 @@ LevelUP is only possible due to the excellent work of the following contributors
 Licence & copyright
 -------------------
 
-Copyright (c) 2012-2013 LevelUP contributors (listed above).
+Copyright (c) 2012-2013 LevelDOWN contributors (listed above).
 
-LevelUP is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
+LevelDOWN is licensed under an MIT +no-false-attribs license. 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
+*LevelDOWN 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
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..3e440e3
--- /dev/null
+++ b/index.js
@@ -0,0 +1 @@
+module.exports = require('bindings')('levelup.node')
\ No newline at end of file
diff --git a/lib/errors.js b/lib/errors.js
deleted file mode 100644
index 9337fe4..0000000
--- a/lib/errors.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var errno = require('errno')
-
-  , LevelUPError = errno.custom.createError('LevelUPError')
-
-module.exports = {
-    LevelUPError        : LevelUPError
-  , InitializationError : errno.custom.createError('InitializationError', LevelUPError)
-  , OpenError           : errno.custom.createError('OpenError', LevelUPError)
-  , ReadError           : errno.custom.createError('ReadError', LevelUPError)
-  , WriteError          : errno.custom.createError('WriteError', LevelUPError)
-  , NotFoundError       : errno.custom.createError('NotFoundError', LevelUPError)
-  , CloseError          : errno.custom.createError('CloseError', LevelUPError)
-}
diff --git a/lib/levelup.js b/lib/levelup.js
deleted file mode 100644
index ecd7318..0000000
--- a/lib/levelup.js
+++ /dev/null
@@ -1,381 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var bridge       = require('bindings')('levelup.node')
-  , EventEmitter = require('events').EventEmitter
-  , inherits     = require('util').inherits
-
-  , errors       = require('./errors')
-  , readStream   = require('./read-stream')
-  , writeStream  = require('./write-stream')
-  , extend       = require('util')._extend
-  , toEncoding   = require('./util').toEncoding
-  , toSlice      = require('./util').toSlice
-  , encodings    = require('./util').encodings
-
-  , defaultOptions = {
-        createIfMissing : true
-      , errorIfExists   : false
-      , encoding        : 'utf8'
-      , keyEncoding     : null
-      , valueEncoding   : null
-      , compression     : true
-    }
-
-  , encodingOpts = (function () {
-      var eo = {}
-      encodings.forEach(function (e) { eo[e] = { encoding: e } })
-      return eo
-    }())
-
-  , getOptions = function (options, globalOptions) {
-      return typeof options == 'string' // just an encoding
-        ? options = extend({}, encodingOpts[options] || encodingOpts[defaultOptions.encoding])
-        : extend(extend({}, globalOptions), options)
-    }
-
-  , getCallback = function (options_, callback_) {
-      return typeof options_ == 'function' ? options_ : callback_
-    }
-
-// Possible this._status values:
-//  - 'new'     - newly created, not opened or closed
-//  - 'opening' - waiting for the database to be opened, post open()
-//  - 'open'    - successfully opened the database, available for use
-//  - 'closing' - waiting for the database to be closed, post close()
-//  - 'closed'  - database has been successfully closed, should not be used
-//                except for another open() operation
-
-function LevelUP (location, options) {
-  EventEmitter.call(this)
-  this.setMaxListeners(Infinity)
-  
-  this._options = extend(extend({}, defaultOptions), options)
-  this._location = location
-  this._status = 'new'
-}
-
-inherits(LevelUP, EventEmitter)
-
-LevelUP.prototype.open = function (callback) {
-
-  if (this.isOpen()) {
-    if (callback)
-      process.nextTick(callback.bind(null, null, this))
-    return this
-  }
-
-  if (this._status == 'opening')
-    return callback && this.once('open', callback.bind(null, null, this))
-
-  this._status = 'opening'
-  var execute = function () {
-    var db = bridge.createDatabase()
-    db.open(this._location, this._options, function (err) {
-      if (err) {
-        err = new errors.OpenError(err)
-        if (callback)
-          return callback(err)
-        this.emit('error', err)
-      } else {
-        this._db = db
-        this._status = 'open'
-        if (callback)
-          callback(null, this)
-        this.emit('open')
-        this.emit('ready')
-      }
-    }.bind(this))
-  }.bind(this)
-
-  execute()
-  this.emit('opening')
-}
-
-//TODO: we can crash Node by submitting an operation between close() and the actual closing of the database
-LevelUP.prototype.close = function (callback) {
-  if (this.isOpen()) {
-    this._status = 'closing'
-    this._db.close(function () {
-      this._status = 'closed'
-      this.emit('closed')
-      if (callback)
-        callback.apply(null, arguments)
-    }.bind(this))
-    this.emit('closing')
-    this._db = null
-  } else if (this._status == 'closed') {
-    if (callback)
-      callback()
-  } else if (this._status == 'closing') {
-    if (callback)
-      this.once('closed', callback)
-  } else if (this._status == 'opening') {
-    this.once('open', function () {
-      this.close(callback)
-    })
-  } else {
-    var err = new errors.CloseError('Cannot close unopened database')
-    if (callback)
-      return callback(err)
-    this.emit('error', err)
-  }
-}
-
-LevelUP.prototype.isOpen = function () {
-  return this._status == 'open'
-}
-
-// in between these two there is 'new' and 'opening'
-
-LevelUP.prototype.isClosed = function () {
-  // covers 'closing' and 'closed'
-  return (/^clos/).test(this._status)
-}
-
-LevelUP.prototype.get = function (key_, options_, callback_) {
-  var open = this.isOpen()
-  , callback, options, key, keyEnc, valueEnc, err
-  
-  if (!open && !this.isClosed()) {
-    // limbo, defer the operation
-    return this.once('ready', function () {
-      this.get(key_, options_, callback_)
-    })
-  }
-  
-  callback = getCallback(options_, callback_)
-  
-  if (open) {
-    options  = getOptions(options_, this._options)
-    keyEnc   = options.keyEncoding   || options.encoding
-    valueEnc = options.valueEncoding || options.encoding
-    key      = toSlice[keyEnc](key_)
-    options.asBuffer = valueEnc != 'utf8' && valueEnc != 'json'
-    this._db.get(key, options, function (err, value) {
-      if (err) {
-        err = new errors.NotFoundError('Key not found in database [' + key_ + ']')
-        if (callback)
-          return callback(err)
-        throw err
-      }
-      if (callback)
-        callback(null, toEncoding[valueEnc](value), key_)
-    })
-  } else {
-    err = new errors.ReadError('Database is not open')
-    if (callback)
-      return callback(err)
-    throw err
-  }
-}
-
-LevelUP.prototype.put = function (key_, value_, options_, callback_) {
-  var open = this.isOpen()
-  , callback, options, err, key, value
-  
-  if (!open && !this.isClosed()) {
-    // limbo, defer the operation
-    return this.once('ready', function () {
-      this.put(key_, value_, options_, callback_)
-    })
-  }
-  
-  callback = getCallback(options_, callback_)
-  
-  if (open) {
-    options  = getOptions(options_, this._options)
-    key      = toSlice[options.keyEncoding   || options.encoding](key_)
-    value    = toSlice[options.valueEncoding || options.encoding](value_)
-    this._db.put(key, value, options, function (err) {
-      if (err) {
-        err = new errors.WriteError(err)
-        if (callback)
-          return callback(err)
-        this.emit('error', err)
-      } else {
-        this.emit('put', key_, value_)
-        if (callback)
-          callback(null, key, value)
-      }
-    }.bind(this))
-  } else {
-    err = new errors.WriteError('Database is not open')
-    if (callback)
-      return callback(err)
-    throw err
-  }
-}
-
-LevelUP.prototype.del = function (key_, options_, callback_) {
-  var open, callback, options, err, key
-  
-  if (!(open = this.isOpen()) && !this.isClosed()) {
-    // limbo, defer the operation
-    return this.once('ready', function () {
-      this.del(key_, options_, callback_)
-    })
-  }
-  
-  callback = getCallback(options_, callback_)
-  
-  if (open) {
-    options  = getOptions(options_, this._options)
-    key      = toSlice[options.keyEncoding   || options.encoding](key_)
-    this._db.del(key, options, function (err) {
-      if (err) {
-        err = new errors.WriteError(err)
-        if (callback)
-          return callback(err)
-        this.emit('error', err)
-      } else {
-        this.emit('del', key_)
-        if (callback)
-          callback(null, key)
-      }
-    }.bind(this))
-  } else {
-    err = new errors.WriteError('Database is not open')
-    if (callback)
-      return callback(err)
-    throw err
-  }
-}
-
-LevelUP.prototype.batch = function (arr_, options_, callback_) {
-  var callback, options, keyEncoding, valueEncoding, err, arr
-  
-  if (!this.isOpen() && !this.isClosed()) {
-    return this.once('ready', function () {
-      this.batch(arr_, options_, callback_)
-    })
-  }
-  
-  callback = getCallback(options_, callback_)
-  
-  if (this.isClosed()) {
-    err = new errors.WriteError('Database is not open')
-    if (callback)
-      return callback(err)
-    throw err
-  }
-  
-  options       = getOptions(options_, this._options)
-  keyEncoding   = options.keyEncoding   || options.encoding
-  valueEncoding = options.valueEncoding || options.encoding
-  
-  // If we're not dealing with plain utf8 strings or plain
-  // Buffers then we have to do some work on the array to
-  // encode the keys and/or values. This includes JSON types.
-  if ((keyEncoding != 'utf8' && keyEncoding != 'binary')
-      || (valueEncoding != 'utf8' && valueEncoding != 'binary')) {
-    arr = arr_.map(function (e) {
-      if (e.type !== undefined && e.key !== undefined) {
-        var o = {
-          type  : e.type
-          , key   : toSlice[keyEncoding](e.key)
-        }
-        if (e.value !== undefined)
-          o.value = toSlice[valueEncoding](e.value)
-        return o
-      }
-      return {}
-    })
-  } else
-    arr = arr_
-  this._db.batch(arr, options, function (err) {
-    if (err) {
-      err = new errors.WriteError(err)
-      if (callback)
-        return callback(err)
-      this.emit('error', err)
-    } else {
-      this.emit('batch', arr_)
-      if (callback)
-        callback(null, arr)
-    }
-  }.bind(this))
-}
-
-LevelUP.prototype.approximateSize = function(start, end, callback) {
-  var err
-
-  if (!this.isOpen() && !this.isClosed()) {
-    return this.once('ready', function () {
-      this.approximateSize(start, end, callback)
-    })
-  }
-
-  if (this.isClosed()) {
-    err = new errors.WriteError('Database is not open')
-    if (callback)
-      return callback(err)
-    throw err
-  }
-
-  this._db.approximateSize(start, end, function(err, size) {
-    if (err) {
-      err = new errors.OpenError(err)
-      if (callback)
-        return callback(err)
-      this.emit('error', err)
-    } else if (callback)
-      callback(null, size)
-  })
-}
-
-LevelUP.prototype.readStream = function (options) {
-  options = extend(extend({}, this._options), typeof options == 'object' ? options : {})
-  return readStream.create(
-    options
-    , this
-    , function (options) {
-      return bridge.createIterator(this._db, options)
-    }.bind(this)
-  )
-}
-
-LevelUP.prototype.keyStream = function (options) {
-  return this.readStream(extend(options ? extend({}, options) : {}, { keys: true, values: false }))
-}
-
-LevelUP.prototype.valueStream = function (options) {
-  return this.readStream(extend(options ? extend({}, options) : {}, { keys: false, values: true }))
-}
-
-LevelUP.prototype.writeStream = function (options) {
-  return writeStream.create(
-    options || {}
-    , this
-  )
-}
-
-LevelUP.prototype.toString = function () {
-  return 'LevelUP'
-}
-
-module.exports = function (location, options, callback) {
-  if (typeof options == 'function') {
-    callback = options
-    options = {}
-  }
-
-  if (typeof location != 'string') {
-    var message = 'Must provide a location for the database'
-    var error = new errors.InitializationError(message)
-
-    if (callback) {
-      return callback(error)
-    }
-
-    throw error
-  }
-
-  var levelup = new LevelUP(location, options)
-  levelup.open(callback)
-  return levelup
-}
-
-module.exports.copy = require('./util').copy
diff --git a/lib/read-stream.js b/lib/read-stream.js
deleted file mode 100644
index 50fb8b6..0000000
--- a/lib/read-stream.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var Stream       = require('stream').Stream
-  , BufferStream = require('bufferstream')
-  , inherits     = require('util').inherits
-  , extend       = require('util')._extend
-
-  , toEncoding   = require('./util').toEncoding
-  , toSlice      = require('./util').toSlice
-  , setImmediate = require('./util').setImmediate
-
-  , defaultOptions = { keys: true, values: true }
-
-  , makeKeyValueData = function (key, value) {
-      return {
-          key: toEncoding[this._keyEncoding](key)
-        , value: toEncoding[this._valueEncoding](value)
-      }
-    }
-  , makeKeyData = function (key) {
-      return toEncoding[this._keyEncoding](key)
-    }
-  , makeValueData = function (key, value) {
-      return toEncoding[this._valueEncoding](value)
-    }
-  , makeNoData = function () { return null }
-
-
-function ReadStream (options, db, iteratorFactory) {
-  Stream.call(this)
-
-  this._status  = 'ready'
-  this._dataEvent = 'data'
-  this.readable = true
-  this.writable = false
-
-  // purely to keep `db` around until we're done so it's not GCed if the user doesn't keep a ref
-  this._db = db
-
-  options = this._options = extend(extend({}, defaultOptions), options)
-  this._keyEncoding   = options.keyEncoding   || options.encoding
-  this._valueEncoding = options.valueEncoding || options.encoding
-  if (typeof this._options.start != 'undefined')
-    this._options.start = toSlice[this._keyEncoding](this._options.start)
-  if (typeof this._options.end != 'undefined')
-    this._options.end = toSlice[this._keyEncoding](this._options.end)
-  if (typeof this._options.limit != 'number')
-    this._options.limit = -1
-  this._options.keyAsBuffer   = this._keyEncoding != 'utf8'   && this._keyEncoding != 'json'
-  this._options.valueAsBuffer = this._valueEncoding != 'utf8' && this._valueEncoding != 'json'
-
-  this._makeData = this._options.keys && this._options.values
-    ? makeKeyValueData.bind(this) : this._options.keys
-      ? makeKeyData.bind(this) : this._options.values
-        ? makeValueData.bind(this) : makeNoData
-
-
-  var ready = function () {
-    if (this._status == 'ended')
-      return
-    this._iterator = iteratorFactory(this._options)
-    this.emit('ready')
-    this._read()
-  }.bind(this)
-
-  if (db.isOpen())
-    setImmediate(ready)
-  else
-    db.once('ready', ready)
-}
-
-inherits(ReadStream, Stream)
-
-ReadStream.prototype.destroy = function () {
-  this._status = 'destroyed'
-  this._cleanup()
-}
-
-ReadStream.prototype.pause = function () {
-  if (this._status != 'ended' && !/\+paused$/.test(this._status)) {
-    this.emit('pause')
-    this._status += '+paused' // preserve existing status
-  }
-}
-
-ReadStream.prototype.resume = function () {
-  if (this._status != 'ended') {
-    this.emit('resume')
-    this._status = this._status.replace(/\+paused$/, '')
-    this._read()
-  }
-}
-
-ReadStream.prototype.pipe = function (dest) {
-  if (typeof dest.add == 'function' && this._options.type == 'fstream') {
-    this._dataEvent = 'entry'
-    this.on('entry', function (data) {
-      var entry = new BufferStream()
-      entry.path = data.key.toString()
-      entry.type = 'File'
-      entry.props = {
-        type: 'File'
-        , path: data.key.toString()
-      }
-      entry.once('data', process.nextTick.bind(null, entry.end.bind(entry)))
-      entry.pause()
-      if (dest.add(entry) === false) {
-        this.pause()
-      }
-      entry.write(data.value)
-    }.bind(this))
-  }
-  return Stream.prototype.pipe.apply(this, arguments)
-}
-
-ReadStream.prototype._read = function () {
-  if (this._status == 'ready') {
-    this._status = 'reading'
-    this._iterator.next(this._cleanup.bind(this), this._onData.bind(this))
-  }
-}
-
-ReadStream.prototype._onData = function (err, key, value) {
-  if (err)
-    return this._cleanup(err)
-  if (this._status == 'ended')
-    return
-  if (/^reading/.test(this._status))
-    this._status = this._status.replace(/^reading/, 'ready')
-  this._read()
-  this.emit(this._dataEvent, this._makeData(key, value))
-}
-
-ReadStream.prototype._cleanup = function (err) {
-  var s = this._status
-  this._status = 'ended'
-  this.readable = false
-  if (this._iterator) {
-    this._iterator.end(function () {
-      this.emit('close')
-    }.bind(this))
-  } else
-    this.emit('close')
-  if (err)
-    this.emit('error', err)
-  else (s != 'destroyed')
-    this.emit('end')
-}
-
-ReadStream.prototype.toString = function () {
-  return 'LevelUP.ReadStream'
-}
-
-module.exports.create = function (options, db, iteratorFactory) {
-  return new ReadStream(options, db, iteratorFactory)
-}
diff --git a/lib/util.js b/lib/util.js
deleted file mode 100644
index d5aa854..0000000
--- a/lib/util.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var encodings = 'hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le'.split(' ')
-
-  , toSlice = (function () {
-      var slicers = {}
-      slicers.json = JSON.stringify.bind(JSON)
-      slicers.utf8 = function (data) {
-        return data === undefined || data === null || Buffer.isBuffer(data) ? data : String(data)
-      }
-      encodings.forEach(function (enc) {
-        if (slicers[enc]) return
-        slicers[enc] = function (data) {
-          return data === undefined || data === null || Buffer.isBuffer(data) ? data : new Buffer(data, enc)
-        }
-      })
-      return slicers
-    }())
-
-  , toEncoding = (function () {
-      var encoders = {}
-      encoders.json = function (str) { return JSON.parse(str) }
-      encoders.utf8 = function (str) { return str }
-      encoders.binary = function (buffer) { return buffer }
-      encodings.forEach(function (enc) {
-        if (encoders[enc]) return
-        encoders[enc] = function (buffer) { return buffer.toString(enc) }
-      })
-      return encoders
-    }())
-
-  , copy = function (srcdb, dstdb, callback) {
-      srcdb.readStream()
-        .pipe(dstdb.writeStream({useBatch:false}))
-        .on('close', callback ? callback : function () {})
-        .on('error', callback ? callback : function (err) { throw err })
-    }
-
-  , setImmediate = global.setImmediate || process.nextTick
-
-module.exports = {
-    encodings    : encodings
-  , toSlice      : toSlice
-  , toEncoding   : toEncoding
-  , copy         : copy
-  , setImmediate : setImmediate
-}
\ No newline at end of file
diff --git a/lib/write-stream.js b/lib/write-stream.js
deleted file mode 100644
index 63106b2..0000000
--- a/lib/write-stream.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var Stream       = require('stream').Stream
-  , inherits     = require('util').inherits
-  , extend       = require('util')._extend
-  , concatStream = require('concat-stream')
-
-  , setImmediate = require('./util').setImmediate
-
-  , defaultOptions = {}
-
-function WriteStream (options, db) {
-  Stream.call(this)
-  this._options = extend(extend({}, defaultOptions), options)
-  this._db      = db
-  this._buffer  = []
-  this._status  = 'init'
-  this._end     = false
-  this.writable = true
-  this.readable = false
-
-  var ready = function () {
-    if (!this.writable)
-      return
-    this._status = 'ready'
-    this.emit('ready')
-    this._process()
-  }.bind(this)
-
-  if (db.isOpen())
-    setImmediate(ready)
-  else
-    db.once('ready', ready)
-}
-
-inherits(WriteStream, Stream)
-
-WriteStream.prototype.write = function (data) {
-  if (!this.writable)
-    return false
-  this._buffer.push(data)
-  if (this._status != 'init')
-    this._processDelayed()
-  if (this._options.maxBufferLength && this._buffer.length > this._options.maxBufferLength) {
-    this._writeBlock = true
-    return false
-  }
-  return true
-}
-
-WriteStream.prototype.end = function() {
-  setImmediate(function () {
-    this._end = true
-    this._process()
-  }.bind(this))
-}
-
-WriteStream.prototype.destroy = function() {
-  this.writable = false
-  this.end()
-}
-
-WriteStream.prototype.destroySoon = function() {
-  this.end()
-}
-
-WriteStream.prototype.add = function(entry) {
-  if (!entry.props)
-    return
-  if (entry.props.Directory)
-    entry.pipe(this._db.writeStream(this._options))
-  else if (entry.props.File || entry.File || entry.type == 'File')
-    this._write(entry)
-  return true
-}
-
-WriteStream.prototype._processDelayed = function() {
-  setImmediate(this._process.bind(this))
-}
-
-WriteStream.prototype._process = function() {
-  var cb = function (err) {
-    if (!this.writable)
-      return
-    if (this._status != 'closed')
-      this._status = 'ready'
-    if (err) {
-      this.writable = false
-      return this.emit('error', err)
-    }
-    this._process()
-  }.bind(this)
-  , buffer, entry
-
-  if (this._status != 'ready' && this.writable) {
-    if (this._buffer.length && this._status != 'closed')
-      this._processDelayed()
-    return
-  }
-
-  if (this._buffer.length && this.writable) {
-    this._status = 'writing'
-    buffer = this._buffer
-    this._buffer = []
-    if (this._buffer.length == 1) {
-      entry = this._buffer.pop()
-      if (entry.key !== undefined && entry.value !== undefined)
-        this._db.put(entry.key, entry.value, cb)
-    } else {
-      this._db.batch(buffer.map(function (d) {
-        return { type: 'put', key: d.key, value: d.value }
-      }), cb)
-    }
-    if (this._writeBlock) {
-      this._writeBlock = false
-      this.emit('drain')
-    }
-  }
-
-  if (this._end && this._status != 'closed') {
-    this._status = 'closed'
-    this.writable = false
-    this.emit('close')
-    return
-  }
-}
-
-WriteStream.prototype._write = function (entry) {
-  var key = entry.path || entry.props.path
-  if (!key)
-    return
-  entry.pipe(concatStream(function (err, data) {
-    if (err) {
-      this.writable = false
-      return this.emit('error', err)
-    }
-    if (this._options.fstreamRoot && key.indexOf(this._options.fstreamRoot) > -1)
-      key = key.substr(this._options.fstreamRoot.length + 1)
-    this.write({ key: key, value: data })
-  }.bind(this)))
-}
-
-WriteStream.prototype.toString = function () {
-  return 'LevelUP.WriteStream'
-}
-
-module.exports.create = function (options, db) {
-  return new WriteStream(options, db)
-}
diff --git a/package.json b/package.json
index 7aa12d0..df15122 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
-    "name"            : "levelup"
-  , "description"     : "Fast & simple storage - a Node.js-style LevelDB wrapper"
+    "name"            : "leveldown"
+  , "description"     : "A Node.js LevelDB binding (currently being extracted from LevelUP)"
   , "contributors"    : [
         "Rod Vagg <r at va.gg> (https://github.com/rvagg)"
       , "John Chesley <john at chesl.es> (https://github.com/chesles/)"
@@ -14,37 +14,22 @@
     ]
   , "keywords": [
         "leveldb"
-      , "stream"
       , "database"
       , "db"
       , "store"
       , "storage"
-      , "json"
     ]
-  , "version"         : "0.5.1"
-  , "main"            : "lib/levelup.js"
+  , "version"         : "0.0.0"
+  , "main"            : "index.js"
   , "dependencies"    : {
-        "errno"           : "~0.0.3"
-      , "bindings"        : "~1.0.0"
-      , "concat-stream"   : "~0.0.9"
-      , "bufferstream"    : "~0.5.1"
+        "bindings"        : "~1.0.0"
     }
   , "devDependencies" : {
         "buster"          : "*"
-      , "rimraf"          : "*"
-      , "async"           : "*"
-      , "fstream"         : "*"
-      , "tar"             : "*"
-      , "mkfiletree"      : "*"
-      , "readfiletree"    : "*"
-      , "slow-stream"     : ">=0.0.3"
-      , "delayed"         : "*"
-      , "boganipsum"      : "*"
-      , "du"              : "*"
     }
   , "repository"      : {
         "type"            : "git"
-      , "url"             : "https://github.com/rvagg/node-levelup.git"
+      , "url"             : "https://github.com/rvagg/node-leveldown.git"
     }
   , "scripts"         : {
         "test"            : "buster-test"
diff --git a/test/benchmarks/README.md b/test/benchmarks/README.md
deleted file mode 100644
index ef6d0bf..0000000
--- a/test/benchmarks/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# LevelUP Benchmarks
-
-## Using
-
-In this directory:
-
-```sh
-$ npm install
-$ node ./
-```
-
-## Philosophy
-
-LevelUP's primary goal is to provide a ***safe***, ***useful*** and ***natural*** Node.js API on top of LevelDB. Performance is important but not at the expense of safety or the utility of the API.
-
-The goal of this benchmark suite is to:
-
-  * Pinpoint areas where performance can/should be improved
-  * Prevent performance regressions between releases
-  * Compare the suitability of LevelUP/LevelDB as a persistent storage mechanism for Node.js (e,g. what do you gain in terms of performance by sacrificing a more rich query interface available in something like SQLite?)
-
-## About
-
-Currently, we the benchmarks run for the current version of LevelUP (i.e. `require('../../')`), the version of LevelUP currently in npm, [Leveled](https://github.com/juliangruber/node-leveled) and [node-sqlite3](https://github.com/developmentseed/node-sqlite3/). Benchmarks for LevelUP with compression disabled can also be run by editing the *engins/index.js* file.
-
-**Leveled** is a minimal binding that is mostly implemented in C++ with few options, only `String` data-types and minimal safety checks. Therefore it's an excellent baseline for performance that LevelUP can aspire to.
-
-**SQLite3** is included to see how an alternative persistent k/v store can perform. The comparison is only fair when considering a simple k/v store and in this regard the main SQLite3 binding performs poorly.
-
-## How does it work?
-
-The main benchmark runner is *./index.js*, it uses [Benchmark.js](http://benchmarkjs.com/) to do the heavy lifting and measuring. "Engines" (i.e. databases) are specified in the *./engines/* directory, to add a new engine/database simply follow the pattern used for the existing ones. The benchmark tests themselves are stored in the *./tests/* directory. *./tests/index.js* lists them all and uses a simple `require()` to pull them in from the various files. The tests index maps the engine  [...]
-
-Tests without a mapping for a given engine are simply not invoked for that engine.
-
-Individual tests can be singled out by prepending `'=>'` to the *name* of the test. The runner will then single that test out and only run it with the various engines.
-
-## Contributing
-
-Yes please! I'd love help making these more rigorous and meaningful. Please contribute if you see something you can add.
-
-Bother *@rvagg* if you have trouble working any of this out.
\ No newline at end of file
diff --git a/test/benchmarks/engines/index.js b/test/benchmarks/engines/index.js
deleted file mode 100644
index 22a1caf..0000000
--- a/test/benchmarks/engines/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-module.exports.LevelUP = require('./levelup')
-module.exports.LevelUP.color = 'green'
-
-module.exports['LevelUP (release)'] = require('./levelup-release')
-module.exports['LevelUP (release)'].color = 'yellow'
-
-//module.exports['LevelUP (no Snappy)'] = require('./levelup-nosnappy')
-//module.exports['LevelUP (no Snappy)'].color = 'magenta'
-
-module.exports.Leveled = require('./leveled')
-module.exports.Leveled.color = 'cyan'
-
-module.exports.SQLite3 = require('./sqlite3')
-module.exports.SQLite3.color = 'blue'
\ No newline at end of file
diff --git a/test/benchmarks/engines/leveled.js b/test/benchmarks/engines/leveled.js
deleted file mode 100644
index 1f3e6b6..0000000
--- a/test/benchmarks/engines/leveled.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var leveled = require('leveled')
-
-  , createDb = function (location, callback) {
-      var db = leveled(location) // no callback, is it sync?
-      setTimeout(callback.bind(null, null, db), 50)
-    }
-
-  , closeDb = function (db, callback) {
-      // has no close()
-      callback()
-    }
-
-module.exports = {
-    createDb : createDb
-  , closeDb  : closeDb
-}
\ No newline at end of file
diff --git a/test/benchmarks/engines/levelup-nosnappy.js b/test/benchmarks/engines/levelup-nosnappy.js
deleted file mode 100644
index 350997f..0000000
--- a/test/benchmarks/engines/levelup-nosnappy.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var levelup = require('../../../')
-
-  , createDb = function (location, callback) {
-      levelup(location, { createIfMissing: true, errorIfExists: true, compression: false }, function (err, db) {
-        setTimeout(callback.bind(null, err, db), 50)
-      })
-    }
-
-  , closeDb = function (db, callback) {
-      db.close(callback)
-    }
-
-module.exports = {
-    createDb : createDb
-  , closeDb  : closeDb
-}
\ No newline at end of file
diff --git a/test/benchmarks/engines/levelup-release.js b/test/benchmarks/engines/levelup-release.js
deleted file mode 100644
index b7f38c1..0000000
--- a/test/benchmarks/engines/levelup-release.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var levelup = require('levelup')
-
-  , createDb = function (location, callback) {
-      levelup(location, { createIfMissing: true, errorIfExists: true }, function (err, db) {
-        setTimeout(callback.bind(null, err, db), 50)
-      })
-    }
-
-  , closeDb = function (db, callback) {
-      db.close(callback)
-    }
-
-module.exports = {
-    createDb : createDb
-  , closeDb  : closeDb
-}
\ No newline at end of file
diff --git a/test/benchmarks/engines/levelup.js b/test/benchmarks/engines/levelup.js
deleted file mode 100644
index dc59b6c..0000000
--- a/test/benchmarks/engines/levelup.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var levelup = require('../../../')
-
-  , createDb = function (location, callback) {
-      levelup(location, { createIfMissing: true, errorIfExists: true }, function (err, db) {
-        setTimeout(callback.bind(null, err, db), 50)
-      })
-    }
-
-  , closeDb = function (db, callback) {
-      db.close(callback)
-    }
-
-module.exports = {
-    createDb : createDb
-  , closeDb  : closeDb
-}
\ No newline at end of file
diff --git a/test/benchmarks/engines/sqlite3.js b/test/benchmarks/engines/sqlite3.js
deleted file mode 100644
index 3fc0dc5..0000000
--- a/test/benchmarks/engines/sqlite3.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var sqlite3 = require('sqlite3')
-
-  , createDb = function (location, callback) {
-      var db = new sqlite3.Database(location, function (err) {
-        if (err) return callback(err)
-        db.run("CREATE TABLE bench (key VARCHAR(32), value TEXT)", function (err) {
-          if (err) return callback(err)
-          setTimeout(callback.bind(null, null, db), 50)
-        })
-      })
-    }
-
-  , closeDb = function (db, callback) {
-      db.close() // does it have a callback?
-      setTimeout(callback, 50)
-    }
-
-module.exports = {
-    createDb : createDb
-  , closeDb  : closeDb
-}
\ No newline at end of file
diff --git a/test/benchmarks/index.js b/test/benchmarks/index.js
deleted file mode 100644
index 2d372a5..0000000
--- a/test/benchmarks/index.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-const DB_ROOT = __dirname
-
-var path = require('path')
-  , Benchmark = require('benchmark')
-  , rimraf = require('rimraf')
-  , async = require('async')
-  , engines = require('./engines/')
-  , tests = require('./tests/')
-
-  , dbidx = 0
-
-  , printableEngineName = function (engineName) {
-      var len = Object.keys(engines).reduce(function (m, c) { return Math.max(c.length, m) }, 0)
-      while (engineName.length < len) engineName += ' '
-      return engineName
-    }
-
-  , mklocation = function () {
-      return path.join(DB_ROOT, '_benchdb_' + dbidx++)
-    }
-
-  , mkdb = function (engine, location, callback) {
-      rimraf(location, engine.createDb.bind(null, location, callback))
-    }
-
-  , rmdb = function (engine, db, location, callback) {
-      engine.closeDb(db, rimraf.bind(null, location, callback))
-    }
-
-  , run = function (db, name, fn, color, cb) {
-      var exec = function () {
-        new Benchmark(name, {
-          'defer': true,
-          'fn': function  (deferred) {
-            fn(db, deferred.resolve.bind(deferred))
-          }
-        })
-        .on('complete', function(event) {
-          console.log(String(event.target)[color].bold)
-          cb()
-        })
-        .run({ async: true })
-      }
-
-      if (fn.setup) {
-        fn.setup(db, function (err) {
-          if (err) return cb(err)
-          exec()
-        })
-      } else
-        exec()
-    }
-
-  , runTest = function (testName, callback) {
-      async.forEachSeries(
-          Object.keys(engines)
-        , function (engineKey, callback) {
-            var engine = engines[engineKey]
-            var location = mklocation()
-            mkdb(engine, location, function (err, db) {
-              if (err) return callback(err)
-              if (!tests[testName][engineKey]) { console.log('Skipping for', testName, engineKey); return callback() }
-              run(
-                  db
-                , printableEngineName(engineKey) + ' ' + testName
-                , tests[testName][engineKey]
-                , engine.color
-                , function (err) {
-                    rmdb(engine, db, location, function (_err) {
-                      callback(err || _err)
-                    })
-                  }
-              )
-            })
-          }
-        , function () {
-            console.log()
-            callback.apply(null, arguments)
-          }
-      )
-    }
-
-  , focusKey = Object.keys(tests).filter(function (k) { return (/\=>/).test(k) })
-
-if (focusKey.length) {
-  var focusTest = tests[focusKey[0]]
-  tests = {}
-  tests[focusKey[0]] = focusTest
-}
-
-require('colors')
-async.forEachSeries(Object.keys(tests), runTest)
\ No newline at end of file
diff --git a/test/benchmarks/package.json b/test/benchmarks/package.json
deleted file mode 100644
index 11f0ad9..0000000
--- a/test/benchmarks/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-    "name": "levelup-benchmarks"
-  , "version": "0.0.0"
-  , "description": "benchmarks for LevelUP"
-  , "main": "index.js"
-  , "private": true
-  , "dependencies": {
-        "benchmark": "~1.0.0"
-      , "colors": "~0.6.0-1"
-      , "rimraf": "~2.0.2"
-      , "async": "~0.1.22"
-      , "levelup": "*"
-      , "leveled": "*"
-      , "sqlite3": "*"
-    }
-}
\ No newline at end of file
diff --git a/test/benchmarks/tests/batch_int_string_x100000_leveled.js b/test/benchmarks/tests/batch_int_string_x100000_leveled.js
deleted file mode 100644
index 5b74c81..0000000
--- a/test/benchmarks/tests/batch_int_string_x100000_leveled.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./batch_int_string_x1000_leveled').fn.bind(null, 100000)
\ No newline at end of file
diff --git a/test/benchmarks/tests/batch_int_string_x100000_levelup.js b/test/benchmarks/tests/batch_int_string_x100000_levelup.js
deleted file mode 100644
index cd8e481..0000000
--- a/test/benchmarks/tests/batch_int_string_x100000_levelup.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./batch_int_string_x1000_levelup').fn.bind(null, 100000)
\ No newline at end of file
diff --git a/test/benchmarks/tests/batch_int_string_x1000_leveled.js b/test/benchmarks/tests/batch_int_string_x1000_leveled.js
deleted file mode 100644
index 2e98440..0000000
--- a/test/benchmarks/tests/batch_int_string_x1000_leveled.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var fn = function (puts, db, cb) {
-  var after = function (err) {
-        if (err) throw err
-        cb()
-      }
-    , batch = db.batch()
-
-  if (this.cycle == null) this.cycle = 0
-  else this.cycle++
-
-  for (var i = 0; i < puts; i++)
-    batch.put(
-        String(this.cycle * puts + i)
-      , "It'll be top end no worries stands out like a bushie. It'll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."
-    )
-  batch.write(after)
-}
-
-module.exports = fn.bind(null, 1000)
-module.exports.fn = fn
\ No newline at end of file
diff --git a/test/benchmarks/tests/batch_int_string_x1000_levelup.js b/test/benchmarks/tests/batch_int_string_x1000_levelup.js
deleted file mode 100644
index 4f559ee..0000000
--- a/test/benchmarks/tests/batch_int_string_x1000_levelup.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var fn = function (puts, db, cb) {
-  var after = function (err) {
-        if (err) throw err
-        cb()
-      }
-    , data = []
-
-  if (this.cycle == null) this.cycle = 0
-  else this.cycle++
-
-  for (var i = 0; i < puts; i++)
-    data.push({
-            type: 'put'
-          , key: this.cycle * puts + i
-          , value: "It'll be top end no worries stands out like a bushie. It'll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."
-        })
-  db.batch(data, after)
-}
-
-module.exports = fn.bind(null, 1000)
-module.exports.fn = fn
\ No newline at end of file
diff --git a/test/benchmarks/tests/get_int_string_x1000_leveled.js b/test/benchmarks/tests/get_int_string_x1000_leveled.js
deleted file mode 100644
index 68b49a4..0000000
--- a/test/benchmarks/tests/get_int_string_x1000_leveled.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var setupFn = function (count, db, cb) {
-  var batch = db.batch()
-  for (var i = 0; i < count; i++)
-    batch.put(
-        String(i)
-      , "It'll be top end no worries stands out like a bushie. It'll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."
-    )
-
-  batch.write(cb)
-}
-
-module.exports = require('./get_int_string_x1000_levelup').bind(null) // bind() to make a new function to put .setup on
-module.exports.setupFn = setupFn
-module.exports.setup = setupFn.bind(null, 1000)
\ No newline at end of file
diff --git a/test/benchmarks/tests/get_int_string_x1000_levelup.js b/test/benchmarks/tests/get_int_string_x1000_levelup.js
deleted file mode 100644
index 22c1bf8..0000000
--- a/test/benchmarks/tests/get_int_string_x1000_levelup.js
+++ /dev/null
@@ -1,29 +0,0 @@
-var setupFn = function (count, db, cb) {
-      var data = []
-
-      for (var i = 0; i < count; i++)
-        data.push({
-            type: 'put'
-          , key: String(i)
-          , value: "It'll be top end no worries stands out like a bushie. It'll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."
-        })
-
-      db.batch(data, cb)
-    }
-
-  , fn = function (count, db, cb) {
-      var received = 0
-        , after = function (err) {
-            if (err) throw err
-            if (++received == count) cb()
-          }
-
-      for (var i = 0; i < count; i++)
-        db.get(String(i), after)
-    }
-
-
-module.exports = fn.bind(null, 1000)
-module.exports.fn = fn
-module.exports.setup = setupFn.bind(null, 1000)
-module.exports.setupFn = setupFn
\ No newline at end of file
diff --git a/test/benchmarks/tests/get_int_string_x1000_sqlite3.js b/test/benchmarks/tests/get_int_string_x1000_sqlite3.js
deleted file mode 100644
index 5316856..0000000
--- a/test/benchmarks/tests/get_int_string_x1000_sqlite3.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var async = require('async')
-
-  , setupFn = function (count, db, cb) {
-      var queue = async.queue(function (key, callback) {
-        db.exec(
-            'INSERT INTO bench VALUES('
-          + key
-          + ', "It\'ll be top end no worries stands out like a bushie. It\'ll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."'
-          + ')'
-          , callback
-        )
-      }, 20)
-      queue.drain = cb
-      for (var i = 0; i < count; i++)
-        queue.push(String(i))
-    }
-
-  , fn = function (count, db, cb) {
-      var received = 0
-        , after = function (err) {
-            if (err) throw err
-            if (++received == count) cb()
-          }
-
-      for (var i = 0; i < count; i++)
-        db.get('SELECT value FROM bench WHERE key = "' + i + '"', after)
-    }
-
-
-module.exports = fn.bind(null, 1000)
-module.exports.fn = fn
-module.exports.setup = setupFn.bind(null, 1000)
-module.exports.setupFn = setupFn
\ No newline at end of file
diff --git a/test/benchmarks/tests/get_int_string_x10_leveled.js b/test/benchmarks/tests/get_int_string_x10_leveled.js
deleted file mode 100644
index 913df45..0000000
--- a/test/benchmarks/tests/get_int_string_x10_leveled.js
+++ /dev/null
@@ -1,2 +0,0 @@
-module.exports = require('./get_int_string_x1000_levelup').fn.bind(null, 10)
-module.exports.setup = require('./get_int_string_x1000_leveled').setupFn.bind(null, 10)
\ No newline at end of file
diff --git a/test/benchmarks/tests/get_int_string_x10_levelup.js b/test/benchmarks/tests/get_int_string_x10_levelup.js
deleted file mode 100644
index 3b5f6ea..0000000
--- a/test/benchmarks/tests/get_int_string_x10_levelup.js
+++ /dev/null
@@ -1,2 +0,0 @@
-module.exports = require('./get_int_string_x1000_levelup').fn.bind(null, 10)
-module.exports.setup = require('./get_int_string_x1000_levelup').setupFn.bind(null, 10)
\ No newline at end of file
diff --git a/test/benchmarks/tests/get_int_string_x10_sqlite3.js b/test/benchmarks/tests/get_int_string_x10_sqlite3.js
deleted file mode 100644
index 0b40d50..0000000
--- a/test/benchmarks/tests/get_int_string_x10_sqlite3.js
+++ /dev/null
@@ -1,2 +0,0 @@
-module.exports = require('./get_int_string_x1000_sqlite3').fn.bind(null, 10)
-module.exports.setup = require('./get_int_string_x1000_sqlite3').setupFn.bind(null, 10)
\ No newline at end of file
diff --git a/test/benchmarks/tests/index.js b/test/benchmarks/tests/index.js
deleted file mode 100644
index 085f3d3..0000000
--- a/test/benchmarks/tests/index.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-/*
- * Prefix a test name with '=>' to have only that test run
- */
-
-module.exports = {
-    'put(int, string) x 10': {
-        'LevelUP'             : require('./put_int_string_x10_levelup')
-      , 'LevelUP (release)'   : require('./put_int_string_x10_levelup')
-      , 'LevelUP (no Snappy)' : require('./put_int_string_x10_levelup')
-      , 'Leveled'             : require('./put_int_string_x10_leveled')
-      , 'SQLite3'             : require('./put_int_string_x10_sqlite3')
-    }
-
-  , 'put(int, string) x 1000': {
-        'LevelUP'             : require('./put_int_string_x1000_levelup')
-      , 'LevelUP (release)'   : require('./put_int_string_x1000_levelup')
-      , 'LevelUP (no Snappy)' : require('./put_int_string_x1000_levelup')
-      , 'Leveled'             : require('./put_int_string_x1000_leveled')
-      , 'SQLite3'             : require('./put_int_string_x1000_sqlite3')
-    }
-
-  , 'put(int, string) x 100,000': {
-        'LevelUP'             : require('./put_int_string_x100000_levelup')
-      , 'LevelUP (release)'   : require('./put_int_string_x100000_levelup')
-      , 'LevelUP (no Snappy)' : require('./put_int_string_x100000_levelup')
-      , 'Leveled'             : require('./put_int_string_x100000_leveled')
-      // too slow , 'SQLite3'             : require('./put_int_string_x100000_sqlite3')
-    }
-
-  , 'get(int):string x 10': {
-        'LevelUP'             : require('./get_int_string_x10_levelup')
-      , 'LevelUP (release)'   : require('./get_int_string_x10_levelup')
-      , 'LevelUP (no Snappy)' : require('./get_int_string_x10_levelup')
-      , 'Leveled'             : require('./get_int_string_x10_leveled')
-      , 'SQLite3'             : require('./get_int_string_x10_sqlite3')
-    }
-
-  , 'get(int):string x 1000': {
-        'LevelUP'             : require('./get_int_string_x1000_levelup')
-      , 'LevelUP (release)'   : require('./get_int_string_x1000_levelup')
-      , 'LevelUP (no Snappy)' : require('./get_int_string_x1000_levelup')
-      , 'Leveled'             : require('./get_int_string_x1000_leveled')
-      , 'SQLite3'             : require('./get_int_string_x1000_sqlite3')
-    }
-
-  , 'batch(int, string) x 1000': {
-        'LevelUP'             : require('./batch_int_string_x1000_levelup')
-      , 'LevelUP (release)'   : require('./batch_int_string_x1000_levelup')
-      , 'LevelUP (no Snappy)' : require('./batch_int_string_x1000_levelup')
-      , 'Leveled'             : require('./batch_int_string_x1000_leveled')
-    }
-
-  , 'batch(int, string) x 100,000': {
-        'LevelUP'             : require('./batch_int_string_x100000_levelup')
-      , 'LevelUP (release)'   : require('./batch_int_string_x100000_levelup')
-      , 'LevelUP (no Snappy)' : require('./batch_int_string_x100000_levelup')
-      , 'Leveled'             : require('./batch_int_string_x100000_leveled')
-    }
-}
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x100000_leveled.js b/test/benchmarks/tests/put_int_string_x100000_leveled.js
deleted file mode 100644
index 31c20b3..0000000
--- a/test/benchmarks/tests/put_int_string_x100000_leveled.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x100000_levelup')
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x100000_levelup.js b/test/benchmarks/tests/put_int_string_x100000_levelup.js
deleted file mode 100644
index 2fa883d..0000000
--- a/test/benchmarks/tests/put_int_string_x100000_levelup.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x1000_levelup').fn.bind(null, 100000)
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x100000_sqlite3.js b/test/benchmarks/tests/put_int_string_x100000_sqlite3.js
deleted file mode 100644
index d65c35f..0000000
--- a/test/benchmarks/tests/put_int_string_x100000_sqlite3.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x1000_sqlite3').fn.bind(null, 100000)
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x1000_leveled.js b/test/benchmarks/tests/put_int_string_x1000_leveled.js
deleted file mode 100644
index dcbe622..0000000
--- a/test/benchmarks/tests/put_int_string_x1000_leveled.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x1000_levelup')
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x1000_levelup.js b/test/benchmarks/tests/put_int_string_x1000_levelup.js
deleted file mode 100644
index 2525ccd..0000000
--- a/test/benchmarks/tests/put_int_string_x1000_levelup.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var fn = function (puts, db, cb) {
-  var received = 0
-    , after = function (err) {
-        if (err) throw err
-        if (++received == puts) cb()
-      }
-
-  if (this.cycle == null) this.cycle = 0
-  else this.cycle++
-
-  for (var i = 0; i < puts; i++)
-    db.put(
-        String(this.cycle * puts + i)
-      , "It'll be top end no worries stands out like a bushie. It'll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."
-      , after
-    )
-}
-
-module.exports = fn.bind(null, 1000)
-module.exports.fn = fn
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x1000_sqlite3.js b/test/benchmarks/tests/put_int_string_x1000_sqlite3.js
deleted file mode 100644
index 64af34b..0000000
--- a/test/benchmarks/tests/put_int_string_x1000_sqlite3.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var fn = function (puts, db, cb) {
-  var received = 0
-    , after = function (err) {
-        if (err) throw err
-        if (++received == puts) cb()
-      }
-
-  if (this.cycle == null) this.cycle = 0
-  else this.cycle++
-
-  for (var i = 0; i < puts; i++)
-    db.exec(
-        'INSERT INTO bench VALUES('
-      + String(this.cycle * puts + i)
-      + ', "It\'ll be top end no worries stands out like a bushie. It\'ll be cream no dramas flat out like a rotten. As busy as a slabs bloody built like a stonkered. Get a dog up ya oldies no dramas lets get some bottle-o. Built like a schooner as busy as a big smoke. You little ripper ute my you little ripper dag."'
-      + ')'
-      , after
-    )
-}
-
-module.exports = fn.bind(null, 1000)
-module.exports.fn = fn
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x10_leveled.js b/test/benchmarks/tests/put_int_string_x10_leveled.js
deleted file mode 100644
index 1832a4a..0000000
--- a/test/benchmarks/tests/put_int_string_x10_leveled.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x10_levelup')
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x10_levelup.js b/test/benchmarks/tests/put_int_string_x10_levelup.js
deleted file mode 100644
index c72cf4f..0000000
--- a/test/benchmarks/tests/put_int_string_x10_levelup.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x1000_levelup').fn.bind(null, 10)
\ No newline at end of file
diff --git a/test/benchmarks/tests/put_int_string_x10_sqlite3.js b/test/benchmarks/tests/put_int_string_x10_sqlite3.js
deleted file mode 100644
index a861217..0000000
--- a/test/benchmarks/tests/put_int_string_x10_sqlite3.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./put_int_string_x1000_sqlite3').fn.bind(null, 10)
\ No newline at end of file
diff --git a/test/binary-test.js b/test/binary-test.js
deleted file mode 100644
index a740d9f..0000000
--- a/test/binary-test.js
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , async   = require('async')
-  , common  = require('./common')
-
-buster.testCase('Binary API', {
-    'setUp': function (done) {
-      common.commonSetUp.call(this)
-      common.loadBinaryTestData(function (err, data) {
-        refute(err)
-        this.testData = data
-        done()
-      }.bind(this))
-    }
-
-  , 'tearDown': common.commonTearDown
-
-  , 'sanity check on test data': function (done) {
-      assert(Buffer.isBuffer(this.testData))
-      common.checkBinaryTestData(this.testData, done)
-    }
-
-  , 'test put() and get() with binary value {encoding:binary}': function (done) {
-      this.openTestDatabase(function (db) {
-        db.put('binarydata', this.testData, { encoding: 'binary' }, function (err) {
-          refute(err)
-          db.get('binarydata', { encoding: 'binary' }, function (err, value) {
-            refute(err)
-            assert(value)
-            common.checkBinaryTestData(value, done)
-          })
-        })
-      }.bind(this))
-    }
-
-  , 'test put() and get() with binary value {encoding:binary} on createDatabase()': function (done) {
-      this.openTestDatabase({ createIfMissing: true, errorIfExists: true, encoding: 'binary' }, function (db) {
-        db.put('binarydata', this.testData, function (err) {
-          refute(err)
-          db.get('binarydata', function (err, value) {
-            refute(err)
-            assert(value)
-            common.checkBinaryTestData(value, done)
-          })
-        })
-      }.bind(this))
-    }
-
-  , 'test put() and get() with binary key {encoding:binary}': function (done) {
-      this.openTestDatabase(function (db) {
-        db.put(this.testData, 'binarydata', { encoding: 'binary' }, function (err) {
-          refute(err)
-          db.get(this.testData, { encoding: 'binary' }, function (err, value) {
-            refute(err)
-            assert.equals(value, 'binarydata')
-            done()
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test put() and get() with binary value {keyEncoding:utf8,valueEncoding:binary}': function (done) {
-      this.openTestDatabase(function (db) {
-        db.put('binarydata', this.testData, { keyEncoding: 'utf8', valueEncoding: 'binary' }, function (err) {
-          refute(err)
-          db.get('binarydata', { keyEncoding: 'utf8', valueEncoding: 'binary' }, function (err, value) {
-            refute(err)
-            assert(value)
-            common.checkBinaryTestData(value, done)
-          })
-        })
-      }.bind(this))
-    }
-
-  , 'test put() and get() with binary value {keyEncoding:utf8,valueEncoding:binary} on createDatabase()': function (done) {
-      this.openTestDatabase({ createIfMissing: true, errorIfExists: true, keyEncoding: 'utf8', valueEncoding: 'binary' }, function (db) {
-        db.put('binarydata', this.testData, function (err) {
-          refute(err)
-          db.get('binarydata', function (err, value) {
-            refute(err)
-            assert(value)
-            common.checkBinaryTestData(value, done)
-          })
-        })
-      }.bind(this))
-    }
-
-  , 'test put() and get() with binary key {keyEncoding:binary,valueEncoding:utf8}': function (done) {
-      this.openTestDatabase(function (db) {
-        db.put(this.testData, 'binarydata', { keyEncoding: 'binary', valueEncoding: 'utf8' }, function (err) {
-          refute(err)
-          db.get(this.testData, { keyEncoding: 'binary', valueEncoding: 'utf8' }, function (err, value) {
-            refute(err)
-            assert.equals(value, 'binarydata')
-            done()
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test put() and get() with binary key & value {encoding:binary}': function (done) {
-      this.openTestDatabase(function (db) {
-        db.put(this.testData, this.testData, { encoding: 'binary' }, function (err) {
-          refute(err)
-          db.get(this.testData, { encoding: 'binary' }, function (err, value) {
-            refute(err)
-            common.checkBinaryTestData(value, done)
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-
-  , 'test put() and del() and get() with binary key {encoding:binary}': function (done) {
-      this.openTestDatabase(function (db) {
-        db.put(this.testData, 'binarydata', { encoding: 'binary' }, function (err) {
-          refute(err)
-          db.del(this.testData, { encoding: 'binary' }, function (err) {
-            refute(err)
-            db.get(this.testData, { encoding: 'binary' }, function (err, value) {
-              assert(err)
-              refute(value)
-              done()
-            }.bind(this))
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'batch() with multiple puts': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(
-            [
-                { type: 'put', key: 'foo', value: this.testData }
-              , { type: 'put', key: 'bar', value: this.testData }
-              , { type: 'put', key: 'baz', value: 'abazvalue' }
-            ]
-          , { keyEncoding: 'utf8',valueEncoding: 'binary' }
-          , function (err) {
-              refute(err)
-              async.forEach(
-                  ['foo', 'bar', 'baz']
-                , function (key, callback) {
-                    db.get(key, { encoding: 'binary' }, function (err, value) {
-                      refute(err)
-                      if (key == 'baz') {
-                        assert.equals(value, 'a' + key + 'value')
-                        callback()
-                      } else {
-                        common.checkBinaryTestData(value, callback)
-                      }
-                    })
-                  }
-                , done
-              )
-            }.bind(this)
-        )
-      }.bind(this))
-    }
-
-
-})
\ No newline at end of file
diff --git a/test/compression-test.js b/test/compression-test.js
deleted file mode 100644
index b3ba4e6..0000000
--- a/test/compression-test.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster     = require('buster')
-  , assert     = buster.assert
-  , async      = require('async')
-  , du         = require('du')
-  , delayed    = require('delayed')
-  , levelup    = require('../')
-  , common     = require('./common')
-
-  , compressableData = new Buffer(Array.apply(null, Array(1024 * 100)).map(function () { return 'aaaaaaaaaa' }).join(''))
-  , multiples = 10
-  , dataSize = compressableData.length * multiples
-
-  , verify = function (location, compression, done) {
-      du(location, function (err, size) {
-        if (err) return refute(err)
-        //console.log(Math.round((size / dataSize) * 100) + '% compression ratio (', size, 'b vs', dataSize, 'b)')
-        if (compression)
-          assert(size < dataSize, 'on-disk size (' + size + ') is less than data size (' + dataSize + ')')
-        else
-          assert(size >= dataSize, 'on-disk size (' + size + ') is greater than data size (' + dataSize + ')')
-        done()
-      })
-    }
-
-    // close, open, close again.. 'compaction' is also performed on open()s
-  , cycle = function (db, compression, callback) {
-      var location = db._location
-      db.close(function (err) {
-        if (err) return refute(err)
-        levelup(location, { errorIfExists: false, compression: compression }, function (err, db) {
-          if (err) return refute(err)
-          db.close(function (err) {
-            if (err) return refute(err)
-            callback()
-          })
-        })
-      })
-    }
-
-buster.testCase('Compression', {
-    'setUp': common.readStreamSetUp
-
-  , 'tearDown': common.commonTearDown
-
-  , 'test data is compressed by default (db.put())': function (done) {
-      this.openTestDatabase(function (db) {
-        async.forEach(
-            Array.apply(null, Array(multiples)).map(function (e, i) {
-              return [ i, compressableData ]
-            })
-          , function (args, callback) {
-              db.put.apply(db, args.concat([callback]))
-            }
-          , cycle.bind(null, db, true, delayed.delayed(verify.bind(null, db._location, true, done), 0.01))
-        )
-      })
-    }
-
-  , 'test data is not compressed with compression=false on open() (db.put())': function (done) {
-      this.openTestDatabase({ createIfMissing: true, errorIfExists: true, compression: false }, function (db) {
-        async.forEach(
-            Array.apply(null, Array(multiples)).map(function (e, i) {
-              return [ i, compressableData ]
-            })
-          , function (args, callback) {
-              db.put.apply(db, args.concat([callback]))
-            }
-          , cycle.bind(null, db, false, delayed.delayed(verify.bind(null, db._location, false, done), 0.01))
-        )
-      })
-    }
-
-  , 'test data is compressed by default (db.batch())': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(
-            Array.apply(null, Array(multiples)).map(function (e, i) {
-              return { type: 'put', key: i, value: compressableData }
-            })
-          , cycle.bind(null, db, false, delayed.delayed(verify.bind(null, db._location, false, done), 0.01))
-        )
-      })
-    }
-})
\ No newline at end of file
diff --git a/test/copy-test.js b/test/copy-test.js
deleted file mode 100644
index 11bbd69..0000000
--- a/test/copy-test.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , levelup = require('../lib/levelup.js')
-  , async   = require('async')
-  , common  = require('./common')
-
-buster.testCase('Copy', {
-    'setUp': common.commonSetUp
-  , 'tearDown': common.commonTearDown
-
-  , 'copy full database': function (done) {
-      var sourceData = []
-
-      for (var i = 0; i < 100; i++) {
-        sourceData.push({
-            type  : 'put'
-          , key   : i
-          , value : Math.random()
-        })
-      }
-
-      var opensrc = function (callback) {
-            this.openTestDatabase(function (db) {
-              db.batch(sourceData.slice(), function (err) {
-                callback(err, db)
-              })
-            })
-          }.bind(this)
-
-        , opendst = function (callback) {
-            this.openTestDatabase(function (db) {
-              callback(null, db)
-            })
-          }.bind(this)
-
-        , verify = function (dstdb) {
-            async.forEach(
-                sourceData
-              , function (data, callback) {
-                  dstdb.get(data.key, function (err, value) {
-                    refute(err)
-                    assert.equals(value, data.value, 'Destination data #' + data.key + ' has correct value')
-                    callback()
-                  })
-                }
-              , done
-            )
-          }.bind(this)
-
-      async.parallel(
-          { src: opensrc, dst: opendst }
-        , function (err, dbs) {
-            refute(err)
-            levelup.copy(dbs.src, dbs.dst, function (err) {
-              refute(err)
-              verify(dbs.dst)
-            })
-          }
-      )
-    }
-})
\ No newline at end of file
diff --git a/test/data/testdata.bin b/test/data/testdata.bin
deleted file mode 100644
index 59229b9..0000000
Binary files a/test/data/testdata.bin and /dev/null differ
diff --git a/test/deferred-open-test.js b/test/deferred-open-test.js
deleted file mode 100644
index 9f7d9eb..0000000
--- a/test/deferred-open-test.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , levelup = require('../lib/levelup.js')
-  , async   = require('async')
-  , common  = require('./common')
-
-buster.testCase('Deferred open()', {
-    'setUp': common.commonSetUp
-  , 'tearDown': common.commonTearDown
-
-  , 'put() and get() on pre-opened database': function (done) {
-      var location = common.nextLocation()
-      // 1) open database without callback, opens in worker thread
-        , db       = levelup(location, { createIfMissing: true, errorIfExists: true, encoding: 'utf8' })
-
-      this.closeableDatabases.push(db)
-      this.cleanupDirs.push(location)
-      assert.isObject(db)
-      assert.equals(db._location, location)
-
-      async.parallel([
-      // 2) insert 3 values with put(), these should be deferred until the database is actually open
-          db.put.bind(db, 'k1', 'v1')
-        , db.put.bind(db, 'k2', 'v2')
-        , db.put.bind(db, 'k3', 'v3')
-      ], function () {
-      // 3) when the callbacks have returned, the database should be open and those values should be in
-      //    verify that the values are there
-        async.forEach(
-            [1,2,3]
-          , function (k, cb) {
-              db.get('k' + k, function (err, v) {
-                refute(err)
-                assert.equals(v, 'v' + k)
-                cb()
-              })
-            }
-            // sanity, this shouldn't exist
-          , function () {
-              db.get('k4', function (err) {
-                assert(err)
-                // DONE
-                done()
-              })
-            }
-        )
-      })
-
-      // we should still be in a state of limbo down here, not opened or closed, but 'new'
-      refute(db.isOpen())
-      refute(db.isClosed())
-    }
-
-  , 'batch() on pre-opened database': function (done) {
-      var location = common.nextLocation()
-      // 1) open database without callback, opens in worker thread
-        , db       = levelup(location, { createIfMissing: true, errorIfExists: true, encoding: 'utf8' })
-
-      this.closeableDatabases.push(db)
-      this.cleanupDirs.push(location)
-      assert.isObject(db)
-      assert.equals(db._location, location)
-
-      // 2) insert 3 values with batch(), these should be deferred until the database is actually open
-      db.batch([
-          { type: 'put', key: 'k1', value: 'v1' }
-        , { type: 'put', key: 'k2', value: 'v2' }
-        , { type: 'put', key: 'k3', value: 'v3' }
-      ], function () {
-      // 3) when the callbacks have returned, the database should be open and those values should be in
-      //    verify that the values are there
-        async.forEach(
-            [1,2,3]
-          , function (k, cb) {
-              db.get('k' + k, function (err, v) {
-                refute(err)
-                assert.equals(v, 'v' + k)
-                cb()
-              })
-            }
-            // sanity, this shouldn't exist
-          , function () {
-              db.get('k4', function (err) {
-                assert(err)
-                // DONE
-                done()
-              })
-            }
-        )
-      })
-
-      // we should still be in a state of limbo down here, not opened or closed, but 'new'
-      refute(db.isOpen())
-      refute(db.isClosed())
-    }
-    
-    
-  , 'maxListeners warning': function (done) {
-      var location   = common.nextLocation()
-      // 1) open database without callback, opens in worker thread
-        , db         = levelup(location, { createIfMissing: true, errorIfExists: true, encoding: 'utf8' })
-        , stderrMock = this.mock(console)
-
-      this.closeableDatabases.push(db)
-      this.cleanupDirs.push(location)
-      stderrMock.expects('error').never()
-
-      // 2) provoke an EventEmitter maxListeners warning
-      var toPut = 11
-
-      for (var i = 0; i < toPut; i++) {
-        db.put('some', 'string', function (err) {
-          refute(err)
-
-          if (!--toPut) {
-            done()
-          }
-        })
-      }
-    }
-})
\ No newline at end of file
diff --git a/test/functional/binary-data-test.js b/test/functional/binary-data-test.js
deleted file mode 100644
index f70b3f7..0000000
--- a/test/functional/binary-data-test.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-/*
- * This test unpacks a tar file, pushes that data into a
- * database then compares the database data with the files
- * on the filesystem.
- * The different types of data are useful for testing, particularly
- * the binary files.
- */
-
-var async     = require('async')
-  , rimraf    = require('rimraf')
-  , tarcommon = require('./tarcommon')
-
-console.log('***************************************************')
-console.log('RUNNING BINARY-DATA-TEST...')
-
-async.series([
-    // pre-clean
-    rimraf.bind(null, tarcommon.dblocation)
-  , rimraf.bind(null, tarcommon.datadir)
-    // extract data for comparison
-  , tarcommon.extract.bind(null, tarcommon.datatar, tarcommon.datadir)
-    // open database
-  , tarcommon.opendb.bind(null, tarcommon.dblocation)
-    // push the data into a database
-  , tarcommon.fstreamWrite
-    // run a sync put & del to force an fs sync
-  , tarcommon.sync
-    // verify database entries are the same as the files
-  , tarcommon.verify
-    // clean up
-  , rimraf.bind(null, tarcommon.dblocation)
-  , rimraf.bind(null, tarcommon.datadir)
-], function (err) {
-  if (err) console.error('Error', err)
-  else console.log('No errors? All good then!')
-  console.log('***************************************************')
-  process.exit(err ? -1 : 0)
-})
\ No newline at end of file
diff --git a/test/functional/compat-test.js b/test/functional/compat-test.js
deleted file mode 100644
index 68a182c..0000000
--- a/test/functional/compat-test.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-/*
- * This test verifies that an existing database contains the
- * correct data, by comparing it to the original data contained
- * in a tar file.
- * Useful for comparing across LevelDB versions.
- */
-
-var async      = require('async')
-  , rimraf     = require('rimraf')
-  , path       = require('path')
-  , tarcommon  = require('./tarcommon')
-
-  , dbtar      = path.join(__dirname, 'test-data.db.tar')
-  , dblocation = path.join(__dirname, 'levelup_test_compat.db')
-
-function runTest (dbtar, callback) {
-  async.series([
-      // pre-clean
-      rimraf.bind(null, tarcommon.dblocation)
-    , rimraf.bind(null, dblocation)
-    , rimraf.bind(null, tarcommon.datadir)
-      // extract existing database
-    , tarcommon.extract.bind(null, dbtar, __dirname)
-      // extract data for comparison
-    , tarcommon.extract.bind(null, tarcommon.datatar, tarcommon.datadir)
-      // open database
-    , tarcommon.opendb.bind(null, dblocation)
-      // verify database entries are the same as the files
-    , tarcommon.verify
-      // clean up
-    , rimraf.bind(null, tarcommon.dblocation)
-    , rimraf.bind(null, dblocation)
-    , rimraf.bind(null, tarcommon.datadir)
-  ], callback)
-}
-
-console.log('***************************************************')
-console.log('RUNNING COMPAT-DATA-TEST...')
-
-runTest(dbtar, function (err) {
-  if (err) throw err
-  console.log('No errors? All good then!')
-  console.log('***************************************************')
-  process.exit(err ? -1 : 0)
-})
\ No newline at end of file
diff --git a/test/functional/fstream-test.js b/test/functional/fstream-test.js
deleted file mode 100644
index a211ad8..0000000
--- a/test/functional/fstream-test.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var assert       = require('buster').assert
-  , refute       = require('buster').refute
-  , fstream      = require('fstream')
-  , async        = require('async')
-  , mkfiletree   = require('mkfiletree')
-  , readfiletree = require('readfiletree')
-  , rimraf       = require('rimraf')
-  , bogan        = require('boganipsum')
-  , levelup      = require('../../lib/levelup')
-
-  , fixtureFiles = {
-        'foo': 'FOO!\n'
-      , 'a directory': {
-            'bogantastic.txt': bogan()
-          , 'subdir': {
-                'boganmeup.dat': bogan()
-              , 'sub sub dir': {
-                    'bar': 'BAR!\n'
-                  , 'maaaaaaaate': bogan()
-                }
-              , 'bang': 'POW'
-            }
-          , 'boo': 'W00t'
-        }
-    }
-  , dblocation = 'levelup_test_fstream.db'
-
-  , opendb = function (dir, callback) {
-      levelup(dblocation, { createIfMissing: true , errorIfExists: false }, function (err, db) {
-        refute(err)
-        callback(null, dir, db)
-      })
-    }
-
-  , fstreamWrite = function (dir, db, callback) {
-      fstream.Reader(dir)
-        .pipe(db.writeStream({ fstreamRoot: dir })
-          .on('close', function () {
-            db.close(function (err) {
-              refute(err)
-              callback(null, dir)
-            })
-          }))
-    }
-
-  , fstreamRead = function (dir, db, callback) {
-      db.readStream({ type: 'fstream' })
-        .pipe(new fstream.Writer({ path: dir + '.out', type: 'Directory' })
-          .on('close', function () {
-            db.close(function (err) {
-              refute(err)
-              callback(null, dir)
-            })
-          })
-        )
-    }
-
-  , verify = function (dir, obj, callback) {
-      assert.equals(obj, fixtureFiles)
-      console.log('Guess what?? It worked!!')
-      callback(null, dir)
-    }
-
-  , cleanUp = function (dir, callback) {
-      async.parallel([
-          rimraf.bind(null, dir + '.out')
-        , rimraf.bind(null, dblocation)
-        , mkfiletree.cleanUp
-      ], callback)
-    }
-
-process.on('uncaughtException', function (err) {
-  refute(err)
-})
-
-console.log('***************************************************')
-console.log('RUNNING FSTREAM-TEST...')
-
-async.waterfall([
-    rimraf.bind(null, dblocation)
-  , mkfiletree.makeTemp.bind(null, 'levelup_test_fstream', fixtureFiles)
-  , opendb
-  , fstreamWrite
-  , opendb
-  , fstreamRead
-  , function (dir, callback) {
-      readfiletree(dir, function (err, obj) {
-        refute(err)
-        callback(err, dir, obj)
-      })
-    }
-  , verify
-  , cleanUp
-  , function () {
-      console.log('***************************************************')
-    }
-])
\ No newline at end of file
diff --git a/test/functional/tarcommon.js b/test/functional/tarcommon.js
deleted file mode 100644
index 8754758..0000000
--- a/test/functional/tarcommon.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var assert       = require('buster').assert
-  , fs           = require('fs')
-  , path         = require('path')
-  , fstream      = require('fstream')
-  , tar          = require('tar')
-  , crypto       = require('crypto')
-  , levelup      = require('../../lib/levelup')
-
-  , dblocation   = path.join(__dirname, 'levelup_test_binary.db')
-  , datatar      = path.join(__dirname, 'test-data.tar')
-  , datadir      = path.join(__dirname, 'test-data')
-  , db
-  , expectedEntries
-
-module.exports.dblocation = dblocation
-module.exports.datatar    = datatar
-module.exports.datadir    = datadir
-
-module.exports.opendb = function (dblocation, callback) {
-  levelup(
-      dblocation
-    , { createIfMissing: true , errorIfExists: false, keyEncoding: 'utf8', valueEncoding: 'binary' }
-    , function (err, _db) {
-        db = _db
-        console.log('Opened database...')
-        callback(err)
-      }
-  )
-}
-
-module.exports.extract = function (tarfile, dir, callback) {
-  expectedEntries = 0
-  fs.createReadStream(tarfile)
-    .pipe(tar.Extract({ path: dir }))
-    .on('entry', function (entry) {
-      if (entry.props.File || entry.File || entry.type == 'File')
-        expectedEntries++
-    })
-    .on('end', function () {
-      console.log('Extracted tar file...')
-      callback()
-    })
-}
-
-module.exports.fstreamWrite = function (callback) {
-  fstream.Reader(datadir)
-    .pipe(db.writeStream({ fstreamRoot: path.resolve(__dirname) })
-      .on('close', function () {
-        console.log('Piped data to database...')
-        callback()
-      }))
-      .on('error', callback)
-}
-
-// using sync:true will force a flush to the fs, otherwise the readStream() is too
-// quick and won't get the full data
-module.exports.sync = function (callback) {
-  db.put('__', '__', { sync: true }, function (err) {
-    if (err) return callback(err)
-    db.del('__', { sync: true }, callback)
-  })
-}
-
-module.exports.verify = function (callback) {
-  var entries = 0
-  db.readStream()
-    .on('data', function (data) {
-      var md5sum = crypto.createHash('md5')
-        , dbmd5sum
-
-      md5sum.update(data.value)
-      dbmd5sum = md5sum.digest('hex')
-      md5sum = crypto.createHash('md5')
-      entries++
-      fs.createReadStream(path.join(__dirname, data.key))
-        .on('data', function (d) { md5sum.update(d) })
-        .on('end', function () {
-          var fsmd5sum = md5sum.digest('hex')
-          assert.equals(
-              dbmd5sum
-            , fsmd5sum
-            , 'MD5 sum compare of ' + data.key + ' failed (' + dbmd5sum + ' != ' + fsmd5sum + ')'
-          )
-        })
-    })
-    .on('end', function () {
-      assert.equals(entries, expectedEntries, 'correct number of entries in the database')
-      console.log('Finished comparing database entries...')
-      console.log('Cleaning up...')
-      callback()
-    })
-}
\ No newline at end of file
diff --git a/test/functional/test-data.db.tar b/test/functional/test-data.db.tar
deleted file mode 100644
index 062f46d..0000000
Binary files a/test/functional/test-data.db.tar and /dev/null differ
diff --git a/test/functional/test-data.tar b/test/functional/test-data.tar
deleted file mode 100644
index 2a69b32..0000000
Binary files a/test/functional/test-data.tar and /dev/null differ
diff --git a/test/idempotent-test.js b/test/idempotent-test.js
deleted file mode 100644
index f4dd924..0000000
--- a/test/idempotent-test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , levelup = require('../lib/levelup.js')
-  , common  = require('./common')
-
-buster.testCase('Idempotent open & close', {
-    'setUp': common.readStreamSetUp
-
-  , 'tearDown': common.commonTearDown
-
-  , 'call open twice, should emit "open" once': function (done) {
-      var location = common.nextLocation()
-        , n = 0
-        , m = 0
-        , db
-        , close = function () {
-            var closing = this.spy()
-            db.on('closing', closing)
-            db.on('closed', function () {
-              assert.equals(closing.callCount, 1)
-              assert.equals(closing.getCall(0).args, [])
-              done()
-            })
-
-            //close needs to be idempotent too.
-            db.close()
-            process.nextTick(db.close.bind(db))
-          }.bind(this)
-
-      this.cleanupDirs.push(location)
-
-      db = levelup(
-          location
-        , { createIfMissing: true }
-        , function () {
-            assert.equals(n++, 0, 'callback should fire only once')
-            if (n && m)
-              close()
-          }
-      )
-
-      db.on('open', function () {
-        assert.equals(m++, 0, 'callback should fire only once')
-        if (n && m)
-          close()
-      })
-
-      db.open()
-    }
-})
diff --git a/test/json-test.js b/test/json-test.js
deleted file mode 100644
index 5f7a6c6..0000000
--- a/test/json-test.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , levelup = require('../lib/levelup.js')
-  , async   = require('async')
-  , common  = require('./common')
-
-buster.testCase('JSON API', {
-    'setUp': function () {
-      common.commonSetUp.call(this)
-      this.runTest = function (testData, assertType, done) {
-        var location = common.nextLocation()
-        this.cleanupDirs.push(location)
-        levelup(location, { createIfMissing: true, errorIfExists: true, encoding: 'json' }, function (err, db) {
-          refute(err)
-          if (err) return
-
-          this.closeableDatabases.push(db)
-
-          async.parallel(
-              testData.map(function (d) { return db.put.bind(db, d.key, d.value) })
-            , function (err) {
-                refute(err)
-
-                async.forEach(
-                    testData
-                  , function (d, callback) {
-                      db.get(d.key, function (err, value) {
-                        refute(err)
-                        assert[assertType](d.value, value)
-                        callback()
-                      })
-                    }
-                  , done
-                )
-              }
-          )
-
-        }.bind(this))
-      }
-    }
-
-  , 'tearDown': common.commonTearDown
-
-  , 'simple-object values in "json" encoding': function (done) {
-      this.runTest([
-            { key: '0', value: 0 }
-          , { key: '1', value: 1 }
-          , { key: 'string', value: 'a string' }
-          , { key: 'true', value: true }
-          , { key: 'false', value: false }
-        ], 'same', done)
-    }
-
-  , 'simple-object keys in "json" encoding': function (done) {
-      this.runTest([
-            { value: '0', key: 0 }
-          , { value: '1', key: 1 }
-          , { value: 'string', key: 'a string' }
-          , { value: 'true', key: true }
-          , { value: 'false', key: false }
-        ], 'same', done)
-    }
-
-  , 'complex-object values in "json" encoding': function (done) {
-      this.runTest([
-            { key: '0', value: {
-                foo: 'bar'
-              , bar: [ 1, 2, 3 ]
-              , bang: { yes: true, no: false }
-            }}
-        ], 'equals', done)
-    }
-
-  , 'complex-object keys in "json" encoding': function (done) {
-      this.runTest([
-            { value: '0', key: {
-                foo: 'bar'
-              , bar: [ 1, 2, 3 ]
-              , bang: { yes: true, no: false }
-            }}
-        ], 'same', done)
-    }
-})
\ No newline at end of file
diff --git a/test/key-value-streams-test.js b/test/key-value-streams-test.js
deleted file mode 100644
index af932c2..0000000
--- a/test/key-value-streams-test.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , common  = require('./common')
-
-buster.testCase('Key and Value Streams', {
-    'setUp': function () {
-      common.commonSetUp.call(this)
-
-      this.readySpy   = this.spy()
-      this.dataSpy    = this.spy()
-      this.endSpy     = this.spy()
-      this.sourceData = []
-
-      for (var i = 0; i < 100; i++) {
-        var k = (i < 10 ? '0' : '') + i
-        this.sourceData.push({
-            type  : 'put'
-          , key   : k
-          , value : Math.random()
-        })
-      }
-
-      this.sourceKeys = Object.keys(this.sourceData)
-        .map(function (k) { return this.sourceData[k].key }.bind(this))
-      this.sourceValues = Object.keys(this.sourceData)
-        .map(function (k) { return this.sourceData[k].value }.bind(this))
-
-      this.verify = function (rs, data, done) {
-        assert.isFalse(rs.writable)
-        assert.isFalse(rs.readable)
-        assert.equals(this.readySpy.callCount, 1, 'Stream emitted single "ready" event')
-        assert.equals(this.endSpy.callCount, 1, 'Stream emitted single "end" event')
-        assert.equals(this.dataSpy.callCount, data.length, 'Stream emitted correct number of "data" events')
-        data.forEach(function (d, i) {
-          var call = this.dataSpy.getCall(i)
-          if (call) {
-            //console.log('call', i, ':', call.args[0].key, '=', call.args[0].value, '(expected', d.key, '=', d.value, ')')
-            assert.equals(call.args.length, 1, 'Stream "data" event #' + i + ' fired with 1 argument')
-            assert.equals(call.args[0], d, 'Stream correct "data" event #' + i + ': ' + d)
-          }
-        }.bind(this))
-        done()
-      }.bind(this)
-    }
-
-  , 'tearDown': common.commonTearDown
-
-  , 'test .keyStream()': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.keyStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data', this.dataSpy)
-          rs.on('end', this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, this.sourceKeys, done))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test .readStream({keys:true,values:false})': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ keys: true, values: false })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data', this.dataSpy)
-          rs.on('end', this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, this.sourceKeys, done))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test .valueStream()': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.valueStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data', this.dataSpy)
-          rs.on('end', this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, this.sourceValues, done))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test .readStream({keys:false,values:true})': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ keys: false, values: true })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data', this.dataSpy)
-          rs.on('end', this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, this.sourceValues, done))
-        }.bind(this))
-      }.bind(this))
-    }
-})
\ No newline at end of file
diff --git a/test/read-stream-test.js b/test/read-stream-test.js
deleted file mode 100644
index f59975e..0000000
--- a/test/read-stream-test.js
+++ /dev/null
@@ -1,633 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster     = require('buster')
-  , assert     = buster.assert
-  , levelup    = require('../lib/levelup.js')
-  , common     = require('./common')
-  , SlowStream = require('slow-stream')
-  , delayed    = require('delayed')
-  , rimraf     = require('rimraf')
-  , async      = require('async')
-
-buster.testCase('ReadStream', {
-    'setUp': common.readStreamSetUp
-
-  , 'tearDown': common.commonTearDown
-
-  //TODO: test various encodings
-
-  , 'test simple ReadStream': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test pausing': function (done) {
-      var calls = 0
-        , rs
-        , pauseVerify = function () {
-            // NOTE: another one *will* slip through because the stream triggers an async read before triggering the event
-            assert.equals(calls, 6, 'stream should still be paused')
-            rs.resume()
-            pauseVerify.called = true
-          }
-        , onData = function () {
-            if (++calls == 5) {
-              rs.pause()
-              setTimeout(pauseVerify, 50)
-            }
-          }
-        , verify = function () {
-            assert.equals(calls, this.sourceData.length, 'onData was used in test')
-            assert(pauseVerify.called, 'pauseVerify was used in test')
-            this.verify(rs, done)
-          }.bind(this)
-
-      this.dataSpy = this.spy(onData) // so we can still verify
-
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          rs = db.readStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', verify.bind(this))
-
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test destroy() immediately': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', function () {
-            assert.isFalse(rs.writable)
-            assert.isFalse(rs.readable)
-            assert.equals(this.readySpy.callCount, 0, '"ready" event was not fired')
-            assert.equals(this.dataSpy.callCount , 0, '"data" event was not fired')
-            assert.equals(this.endSpy.callCount  , 0, '"end" event was not fired')
-            done()
-          }.bind(this))
-          rs.destroy()
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test destroy() half way through': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream()
-            , endSpy = this.spy()
-            , calls = 0
-          this.dataSpy = this.spy(function () {
-            if (++calls == 5)
-              rs.destroy()
-          })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , endSpy)
-          rs.on('close', function () {
-            assert.isFalse(rs.writable)
-            assert.isFalse(rs.readable)
-            assert.equals(this.readySpy.callCount, 1, 'ReadStream emitted single "ready" event')
-            // should do "data" 5 times ONLY
-            assert.equals(this.dataSpy.callCount, 5, 'ReadStream emitted correct number of "data" events (5)')
-            this.sourceData.slice(0, 5).forEach(function (d, i) {
-              var call = this.dataSpy.getCall(i)
-              assert(call)
-              if (call) {
-                assert.equals(call.args.length, 1, 'ReadStream "data" event #' + i + ' fired with 1 argument')
-                refute.isNull(call.args[0].key, 'ReadStream "data" event #' + i + ' argument has "key" property')
-                refute.isNull(call.args[0].value, 'ReadStream "data" event #' + i + ' argument has "value" property')
-                assert.equals(call.args[0].key, d.key, 'ReadStream "data" event #' + i + ' argument has correct "key"')
-                assert.equals(call.args[0].value, d.value, 'ReadStream "data" event #' + i + ' argument has correct "value"')
-              }
-            }.bind(this))
-            done()
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "reverse=true"': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ reverse: true })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData.reverse() // for verify
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "start"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ start: '50' })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // slice off the first 50 so verify() expects only the last 50 even though all 100 are in the db
-          this.sourceData = this.sourceData.slice(50)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "start" and "reverse=true"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ start: '50', reverse: true })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // reverse and slice off the first 50 so verify() expects only the first 50 even though all 100 are in the db
-          this.sourceData.reverse()
-          this.sourceData = this.sourceData.slice(49)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "start" being mid-way key (float)': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          // '49.5' doesn't actually exist but we expect it to start at '50' because '49' < '49.5' < '50' (in string terms as well as numeric)
-          var rs = db.readStream({ start: '49.5' })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // slice off the first 50 so verify() expects only the last 50 even though all 100 are in the db
-          this.sourceData = this.sourceData.slice(50)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "start" being mid-way key (float) and "reverse=true"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          //NOTE: this is similar to the above case but we're going backwards, the important caveat with
-          // reversable streams is that the start will always be the NEXT key if the actual key you specify
-          // doesn't exist, not the PREVIOUS (i.e. it skips ahead to find a start key)
-          var rs = db.readStream({ start: '49.5', reverse: true })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // reverse & slice off the first 50 so verify() expects only the first 50 even though all 100 are in the db
-          this.sourceData.reverse()
-          this.sourceData = this.sourceData.slice(49)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "start" being mid-way key (string)': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          // '499999' doesn't actually exist but we expect it to start at '50' because '49' < '499999' < '50' (in string terms)
-          // the same as the previous test but we're relying solely on string ordering
-          var rs = db.readStream({ start: '499999' })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // slice off the first 50 so verify() expects only the last 50 even though all 100 are in the db
-          this.sourceData = this.sourceData.slice(50)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "end"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: '50' })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // slice off the last 49 so verify() expects only 0 -> 50 inclusive, even though all 100 are in the db
-          this.sourceData = this.sourceData.slice(0, 51)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "end" being mid-way key (float)': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: '50.5' })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // slice off the last 49 so verify() expects only 0 -> 50 inclusive, even though all 100 are in the db
-          this.sourceData = this.sourceData.slice(0, 51)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "end" being mid-way key (string)': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: '50555555' })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // slice off the last 49 so verify() expects only 0 -> 50 inclusive, even though all 100 are in the db
-          this.sourceData = this.sourceData.slice(0, 51)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "end" being mid-way key (float) and "reverse=true"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: '50.5', reverse: true })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData.reverse()
-          this.sourceData = this.sourceData.slice(0, 49)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with both "start" and "end"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ start: 30, end: 70 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // should include 30 to 70, inclusive
-          this.sourceData = this.sourceData.slice(30, 71)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with both "start" and "end" and "reverse=true"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ start: 70, end: 30, reverse: true })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          // expect 70 -> 30 inclusive
-          this.sourceData.reverse()
-          this.sourceData = this.sourceData.slice(29, 70)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test json encoding': function (done) {
-      var options = { createIfMissing: true, errorIfExists: true, keyEncoding: 'utf8', valueEncoding: 'json' }
-        , data = [
-              { type: 'put', key: 'aa', value: { a: 'complex', obj: 100 } }
-            , { type: 'put', key: 'ab', value: { b: 'foo', bar: [ 1, 2, 3 ] } }
-            , { type: 'put', key: 'ac', value: { c: 'w00t', d: { e: [ 0, 10, 20, 30 ], f: 1, g: 'wow' } } }
-            , { type: 'put', key: 'ba', value: { a: 'complex', obj: 100 } }
-            , { type: 'put', key: 'bb', value: { b: 'foo', bar: [ 1, 2, 3 ] } }
-            , { type: 'put', key: 'bc', value: { c: 'w00t', d: { e: [ 0, 10, 20, 30 ], f: 1, g: 'wow' } } }
-            , { type: 'put', key: 'ca', value: { a: 'complex', obj: 100 } }
-            , { type: 'put', key: 'cb', value: { b: 'foo', bar: [ 1, 2, 3 ] } }
-            , { type: 'put', key: 'cc', value: { c: 'w00t', d: { e: [ 0, 10, 20, 30 ], f: 1, g: 'wow' } } }
-          ]
-
-      this.openTestDatabase(options, function (db) {
-        db.batch(data.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done, data))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() "reverse=true" not sticky (issue #6)': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-          // read in reverse, assume all's good
-          var rs = db.readStream({ reverse: true })
-          rs.on('close', function () {
-            // now try reading the other way
-            var rs = db.readStream()
-            assert.isFalse(rs.writable)
-            assert.isTrue(rs.readable)
-            rs.on('ready', this.readySpy)
-            rs.on('data' , this.dataSpy)
-            rs.on('end'  , this.endSpy)
-            rs.on('close', this.verify.bind(this, rs, done))
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test ReadStream, start=0': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ start: 0 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-        }.bind(this))
-      }.bind(this))
-    }
-
-    // we don't expect any data to come out of here because the keys start at '00' not 0
-    // we just want to ensure that we don't kill the process
-  , 'test ReadStream, end=0': function (done) {
-      this.openTestDatabase(function (db) {
-        // execute
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: 0 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData = [ ]
-        }.bind(this))
-      }.bind(this))
-    }
-
-    // ok, so here's the deal, this is kind of obscure: when you have 2 databases open and
-    // have a readstream coming out from both of them with no references to the dbs left
-    // V8 will GC one of them and you'll get an failed assert from leveldb.
-    // This ISN'T a problem if you only have one of them open, even if the db gets GCed!
-    // Process:
-    //   * open
-    //   * batch write data
-    //   * close
-    //   * reopen
-    //   * create ReadStream, keeping no reference to the db
-    //   * pipe ReadStream through SlowStream just to make sure GC happens
-    //       - the error should occur here if the bug exists
-    //   * when both streams finish, verify all 'data' events happened
-  , 'test ReadStream without db ref doesn\'t get GCed': function (done) {
-      var dataSpy1   = this.spy()
-        , dataSpy2   = this.spy()
-        , location1  = common.nextLocation()
-        , location2  = common.nextLocation()
-        , sourceData = this.sourceData
-        , verify     = function () {
-            // no reference to `db` here, should have been GCed by now if it could be
-            assert(dataSpy1.callCount, sourceData.length)
-            assert(dataSpy2.callCount, sourceData.length)
-            async.parallel([ rimraf.bind(null, location1), rimraf.bind(null, location2) ], done)
-          }
-        , execute    = function (d, callback) {
-            // no reference to `db` here, could be GCed
-            d.readStream
-              .pipe(new SlowStream({ maxWriteInterval: 5 }))
-              .on('data', d.spy)
-              .on('end', delayed.delayed(callback, 0.05))
-          }
-        , open       = function (reopen, location, callback) {
-            levelup(location, { createIfMissing: !reopen, errorIfExists: !reopen }, callback)
-          }
-        , write      = function (db, callback) { db.batch(sourceData.slice(), callback) }
-        , close      = function (db, callback) { db.close(callback) }
-        , setup      = function (callback) {
-            async.map([ location1, location2 ], open.bind(null, false), function (err, dbs) {
-              refute(err)
-              if (err) return
-              async.map(dbs, write, function (err) {
-                refute(err)
-                if (err) return
-                async.forEach(dbs, close, callback)
-              })
-            })
-          }
-        , reopen    = function () {
-            async.map([ location1, location2 ], open.bind(null, true), function (err, dbs) {
-              refute(err)
-              if (err) return
-              async.forEach([
-                  { readStream: dbs[0].readStream(), spy: dataSpy1 }
-                , { readStream: dbs[1].readStream(), spy: dataSpy2 }
-              ], execute, verify)
-            })
-          }
-
-      setup(delayed.delayed(reopen, 0.05))
-    }
-
-
-    // this is just a fancy way of testing levelup('/path').readStream()
-    // i.e. not waiting for 'open' to complete
-    // the logic for this is inside the ReadStream constructor which waits for 'ready'
-  , 'test ReadStream on pre-opened db': function (done) {
-      var execute = function (db) {
-            // is in limbo
-            refute(db.isOpen())
-            refute(db.isClosed())
-
-            var rs = db.readStream()
-            assert.isFalse(rs.writable)
-            assert.isTrue(rs.readable)
-            rs.on('ready', this.readySpy)
-            rs.on('data' , this.dataSpy)
-            rs.on('end'  , this.endSpy)
-            rs.on('close', this.verify.bind(this, rs, done))
-          }.bind(this)
-        , setup = function (db) {
-            db.batch(this.sourceData.slice(), function (err) {
-              refute(err)
-              db.close(function (err) {
-                refute(err)
-                var db2 = levelup(db._location, { createIfMissing: false, errorIfExists: false, encoding: 'utf8' })
-                execute(db2)
-              })
-            }.bind(this))
-          }.bind(this)
-
-      this.openTestDatabase(setup)
-    }
-
-  , 'test readStream() with "limit"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ limit: 20 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData = this.sourceData.slice(0, 20)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "start" and "limit"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ start: '20', limit: 20 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData = this.sourceData.slice(20, 40)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "end" after "limit"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: '50', limit: 20 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData = this.sourceData.slice(0, 20)
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'test readStream() with "end" before "limit"': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          var rs = db.readStream({ end: '30', limit: 50 })
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs.on('ready', this.readySpy)
-          rs.on('data' , this.dataSpy)
-          rs.on('end'  , this.endSpy)
-          rs.on('close', this.verify.bind(this, rs, done))
-
-          this.sourceData = this.sourceData.slice(0, 31)
-        }.bind(this))
-      }.bind(this))
-    }
-})
\ No newline at end of file
diff --git a/test/simple-test.js b/test/simple-test.js
deleted file mode 100644
index 4304891..0000000
--- a/test/simple-test.js
+++ /dev/null
@@ -1,561 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , levelup = require('../lib/levelup.js')
-  , errors  = require('../lib/errors.js')
-  , async   = require('async')
-  , fs      = require('fs')
-  , common  = require('./common')
-
-buster.testCase('Basic API', {
-    'setUp': common.commonSetUp
-  , 'tearDown': common.commonTearDown
-
-  , 'levelup()': function () {
-      assert.isFunction(levelup)
-      assert.equals(levelup.length, 3) // location, options & callback arguments
-      assert.exception(levelup, 'InitializationError') // no location
-    }
-
-  , 'default options': function (done) {
-      var location = common.nextLocation()
-      levelup(location, { createIfMissing: true, errorIfExists: true }, function (err, db) {
-        assert.isTrue(db.isOpen())
-        this.closeableDatabases.push(db)
-        this.cleanupDirs.push(location)
-        db.close(function (err) {
-          refute(err)
-
-          assert.isFalse(db.isOpen())
-
-          levelup(location, function (err, db) { // no options object
-            refute(err)
-            assert.isObject(db)
-            assert.isTrue(db._options.createIfMissing)
-            assert.isFalse(db._options.errorIfExists)
-            assert.equals(db._location, location)
-
-            /*
-            // read-only properties
-            db.location = 'foo'
-            assert.equals(db.location, location)
-            */
-            done()
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'basic options': function (done) {
-      var location = common.nextLocation()
-      levelup(location, { createIfMissing: true, errorIfExists: true }, function (err, db) {
-        refute(err)
-
-        this.closeableDatabases.push(db)
-        this.cleanupDirs.push(location)
-        assert.isObject(db)
-        assert.isTrue(db._options.createIfMissing)
-        assert.isTrue(db._options.errorIfExists)
-        assert.equals(db._location, location)
-
-        /*
-        // read-only properties
-        db._location = 'bar'
-        assert.equals(db._location, location)
-        */
-        done()
-      }.bind(this))
-    }
-
-  , 'without callback': function (done) {
-      var location = common.nextLocation()
-      var db = levelup(location, { createIfMissing: true, errorIfExists: true })
-
-      this.closeableDatabases.push(db)
-      this.cleanupDirs.push(location)
-      assert.isObject(db)
-      assert.isTrue(db._options.createIfMissing)
-      assert.isTrue(db._options.errorIfExists)
-      assert.equals(db._location, location)
-
-      db.on("ready", function () {
-        assert.isTrue(db.isOpen())
-        done()
-      })
-    }
-
-  , 'open() with !createIfMissing expects error': function (done) {
-      levelup(this.cleanupDirs[0] = common.nextLocation(), { createIfMissing: false }, function (err, db) {
-        assert(err)
-        refute(db)
-        assert.isInstanceOf(err, Error)
-        assert.isInstanceOf(err, errors.LevelUPError)
-        assert.isInstanceOf(err, errors.OpenError)
-        done()
-      }.bind(this))
-    }
-
-  , 'open() with createIfMissing expects directory to be created': function (done) {
-      levelup(this.cleanupDirs[0] = common.nextLocation(), { createIfMissing: true }, function (err, db) {
-        this.closeableDatabases.push(db)
-        refute(err)
-        assert.isTrue(db.isOpen())
-        fs.stat(this.cleanupDirs[0], function (err, stat) {
-          refute(err)
-          assert(stat.isDirectory())
-          done()
-        })
-      }.bind(this))
-    }
-
-  , 'open() with errorIfExists expects error if exists': function (done) {
-      levelup(this.cleanupDirs[0] = common.nextLocation(), { createIfMissing: true }, function (err, db) {
-        this.closeableDatabases.push(db)
-        refute(err) // sanity
-        levelup(this.cleanupDirs[0], { errorIfExists   : true }, function (err) {
-          assert(err)
-          assert.isInstanceOf(err, Error)
-          assert.isInstanceOf(err, errors.LevelUPError)
-          assert.isInstanceOf(err, errors.OpenError)
-          done()
-        })
-      }.bind(this))
-    }
-
-  , 'open() with !errorIfExists does not expect error if exists': function (done) {
-      levelup(this.cleanupDirs[0] = common.nextLocation(), { createIfMissing: true }, function (err, db) {
-        refute(err) // sanity
-        this.closeableDatabases.push(db)
-        assert.isTrue(db.isOpen())
-
-        db.close(function () {
-          assert.isFalse(db.isOpen())
-
-          levelup(this.cleanupDirs[0], { errorIfExists   : false }, function (err, db) {
-            refute(err)
-            this.closeableDatabases.push(db)
-            assert.isTrue(db.isOpen())
-            done()
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-
-  , 'Simple operations': {
-
-        'get() on empty database causes error': function (done) {
-          this.openTestDatabase(function (db) {
-            db.get('undefkey', function (err, value) {
-              refute(value)
-              assert.isInstanceOf(err, Error)
-              assert.isInstanceOf(err, errors.LevelUPError)
-              assert.isInstanceOf(err, errors.NotFoundError)
-              assert.match(err, '[undefkey]')
-              done()
-            })
-          })
-        }
-
-      , 'put() and get() simple string key/value pairs': function (done) {
-          this.openTestDatabase(function (db) {
-            db.put('some key', 'some value stored in the database', function (err) {
-              refute(err)
-              db.get('some key', function (err, value) {
-                refute(err)
-                assert.equals(value, 'some value stored in the database')
-                done()
-              })
-            })
-          })
-        }
-
-      , 'del() on empty database doesn\'t cause error': function (done) {
-          this.openTestDatabase(function (db) {
-            db.del('undefkey', function (err) {
-              refute(err)
-              done()
-            })
-          })
-        }
-
-      , 'del() works on real entries': function (done) {
-          this.openTestDatabase(function (db) {
-            async.series(
-                [
-                    function (callback) {
-                      async.forEach(
-                          ['foo', 'bar', 'baz']
-                        , function (key, callback) {
-                            db.put(key, 1 + Math.random(), callback)
-                          }
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      db.del('bar', callback)
-                    }
-                  , function (callback) {
-                      async.forEach(
-                          ['foo', 'bar', 'baz']
-                        , function (key, callback) {
-                            db.get(key, function (err, value) {
-                              // we should get foo & baz but not bar
-                              if (key == 'bar') {
-                                assert(err)
-                                refute(value)
-                              } else {
-                                refute(err)
-                                assert(value)
-                              }
-                              callback()
-                            })
-                          }
-                        , callback
-                      )
-                    }
-                ]
-              , done
-            )
-          })
-        }
-    }
-
-  , 'batch()': {
-        'batch() with multiple puts': function (done) {
-          this.openTestDatabase(function (db) {
-            db.batch(
-                [
-                    { type: 'put', key: 'foo', value: 'afoovalue' }
-                  , { type: 'put', key: 'bar', value: 'abarvalue' }
-                  , { type: 'put', key: 'baz', value: 'abazvalue' }
-                ]
-              , function (err) {
-                  refute(err)
-                  async.forEach(
-                      ['foo', 'bar', 'baz']
-                    , function (key, callback) {
-                        db.get(key, function (err, value) {
-                          refute(err)
-                          assert.equals(value, 'a' + key + 'value')
-                          callback()
-                        })
-                      }
-                    , done
-                  )
-                }
-            )
-          })
-        }
-
-      , 'batch() with multiple puts and deletes': function (done) {
-          this.openTestDatabase(function (db) {
-            async.series(
-                [
-                    function (callback) {
-                      db.batch(
-                          [
-                              { type: 'put', key: '1', value: 'one' }
-                            , { type: 'put', key: '2', value: 'two' }
-                            , { type: 'put', key: '3', value: 'three' }
-                          ]
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      db.batch(
-                          [
-                              { type: 'put', key: 'foo', value: 'afoovalue' }
-                            , { type: 'del', key: '1' }
-                            , { type: 'put', key: 'bar', value: 'abarvalue' }
-                            , { type: 'del', key: 'foo' }
-                            , { type: 'put', key: 'baz', value: 'abazvalue' }
-                          ]
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      // these should exist
-                      async.forEach(
-                          ['2', '3', 'bar', 'baz']
-                        , function (key, callback) {
-                            db.get(key, function (err, value) {
-                              refute(err)
-                              refute.isNull(value)
-                              callback()
-                            })
-                          }
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      // these shouldn't exist
-                      async.forEach(
-                          ['1', 'foo']
-                        , function (key, callback) {
-                            db.get(key, function (err, value) {
-                              assert(err)
-                              assert.isInstanceOf(err, errors.NotFoundError)
-                              refute(value)
-                              callback()
-                            })
-                          }
-                        , callback
-                      )
-                    }
-                ]
-              , done
-            )
-          })
-        }
-
-      , 'batch() with can manipulate data from put()': function (done) {
-          // checks encoding and whatnot
-          this.openTestDatabase(function (db) {
-            async.series(
-                [
-                    db.put.bind(db, '1', 'one')
-                  , db.put.bind(db, '2', 'two')
-                  , db.put.bind(db, '3', 'three')
-                  , function (callback) {
-                      db.batch(
-                          [
-                              { type: 'put', key: 'foo', value: 'afoovalue' }
-                            , { type: 'del', key: '1' }
-                            , { type: 'put', key: 'bar', value: 'abarvalue' }
-                            , { type: 'del', key: 'foo' }
-                            , { type: 'put', key: 'baz', value: 'abazvalue' }
-                          ]
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      // these should exist
-                      async.forEach(
-                          ['2', '3', 'bar', 'baz']
-                        , function (key, callback) {
-                            db.get(key, function (err, value) {
-                              refute(err)
-                              refute.isNull(value)
-                              callback()
-                            })
-                          }
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      // these shouldn't exist
-                      async.forEach(
-                          ['1', 'foo']
-                        , function (key, callback) {
-                            db.get(key, function (err, value) {
-                              assert(err)
-                              assert.isInstanceOf(err, errors.NotFoundError)
-                              refute(value)
-                              callback()
-                            })
-                          }
-                        , callback
-                      )
-                    }
-                ]
-              , done
-            )
-          })
-        }
-
-      , 'batch() data can be read with get() and del()': function (done) {
-          this.openTestDatabase(function (db) {
-            async.series(
-                [
-                    function (callback) {
-                      db.batch(
-                          [
-                              { type: 'put', key: '1', value: 'one' }
-                            , { type: 'put', key: '2', value: 'two' }
-                            , { type: 'put', key: '3', value: 'three' }
-                          ]
-                        , callback
-                      )
-                    }
-                  , db.del.bind(db, '1', 'one')
-                  , function (callback) {
-                      // these should exist
-                      async.forEach(
-                          ['2', '3']
-                        , function (key, callback) {
-                            db.get(key, function (err, value) {
-                              refute(err)
-                              refute.isNull(value)
-                              callback()
-                            })
-                          }
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      // this shouldn't exist
-                      db.get('1', function (err, value) {
-                        assert(err)
-                        assert.isInstanceOf(err, errors.NotFoundError)
-                        refute(value)
-                        callback()
-                      })
-                    }
-                ]
-              , done
-            )
-          })
-        }
-    }
-
-  , 'approximateSize()': {
-        'approximateSize() works on empty database': function (done) {
-          this.openTestDatabase(function (db) {
-            db.approximateSize('a', 'z', function(err, size) {
-              refute(err) // sanity
-              assert.equals(size, 0)
-              done()
-            })
-          })
-        }
-
-      , 'approximateSize() work on none-empty database': function(done) {
-          var location = common.nextLocation()
-          var db
-            async.series(
-                [
-                    function (callback) {
-                      this.openTestDatabase(
-                          location
-                        , function (_db) {
-                          db = _db
-                          callback()
-                        }
-                      )
-                    }.bind(this)
-                  , function (callback) {
-                      var batch = [];
-                      for(var i = 0; i < 10; ++i) {
-                        batch.push({
-                          type: 'put', key: String(i), value: 'afoovalue'
-                        });
-                      }
-                      db.batch(
-                          batch
-                        , { sync: true }
-                        , callback
-                      )
-                    }
-                  , function (callback) {
-                      // close db to make sure stuff gets written to disc
-                      db.close(callback)
-                    }
-                  , function (callback) {
-                      levelup(location, function (err, _db) {
-                          refute(err)
-                          db = _db
-                          callback()
-                        }
-                      )
-                    }
-                  , function (callback) {
-                      db.approximateSize('', '99', function(err, size) {
-                        refute(err) // sanity
-                        refute.equals(size, 0)
-                        done()
-                      })
-                    }
-                ]
-              , done
-            )
-        }
-    }
-
-  , 'null and undefined': {
-        'setUp': function (done) {
-          levelup(this.cleanupDirs[0] = common.nextLocation(), { createIfMissing: true }, function (err, db) {
-            refute(err) // sanity
-            this.closeableDatabases.push(db)
-            assert.isTrue(db.isOpen())
-            this.db = db
-            done()
-          }.bind(this))
-        }
-
-      , 'get() with null key causes error': function (done) {
-          this.db.get(null, function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'get() with undefined key causes error': function (done) {
-          this.db.get(undefined, function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'del() with null key causes error': function (done) {
-          this.db.del(null, function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'del() with undefined key causes error': function (done) {
-          this.db.del(undefined, function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'put() with null key causes error': function (done) {
-          this.db.put(null, 'foo', function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'put() with undefined key causes error': function (done) {
-          this.db.put(undefined, 'foo', function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'put() with null value causes error': function (done) {
-          this.db.put('foo', null, function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-
-      , 'put() with undefined value causes error': function (done) {
-          this.db.put('foo', undefined, function (err, value) {
-            refute(value)
-            assert.isInstanceOf(err, Error)
-            assert.isInstanceOf(err, errors.LevelUPError)
-            done()
-          })
-        }
-    }
-})
diff --git a/test/snapshot-test.js b/test/snapshot-test.js
deleted file mode 100644
index 59011dd..0000000
--- a/test/snapshot-test.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster     = require('buster')
-  , assert     = buster.assert
-  , delayed    = require('delayed')
-  , common     = require('./common')
-  , SlowStream = require('slow-stream')
-
-buster.testCase('Snapshots', {
-    'setUp': common.readStreamSetUp
-
-  , 'tearDown': common.commonTearDown
-
-  , 'test ReadStream implicit snapshot': function (done) {
-      this.openTestDatabase(function (db) {
-
-        // 1) Store 100 random numbers stored in the database
-        db.batch(this.sourceData.slice(), function (err) {
-          refute(err)
-
-          // 2) Create an iterator on the current data, pipe it through a SlowStream
-          //    to make *sure* that we're going to be reading it for longer than it
-          //    takes to overwrite the data in there.
-
-          var rs = db.readStream()
-          assert.isFalse(rs.writable)
-          assert.isTrue(rs.readable)
-          rs = rs.pipe(new SlowStream({ maxWriteInterval: 5 }))
-          this.readySpy()
-          rs.on('data' , this.dataSpy)
-          rs.once('end'  , this.endSpy)
-          rs.on('end', function () {
-            rs.readable = false
-            rs.writable = false
-          })
-
-          rs.once('close', delayed.delayed(this.verify.bind(this, rs, done), 0.05))
-
-          process.nextTick(function () {
-
-            // 3) Concoct and write new random data over the top of existing items.
-            //    If we're not using a snapshot then then we'd expect the test
-            //    to fail because it'll pick up these new values rather than the
-            //    old ones.
-            var newData = []
-            for (var i = 0; i < 100; i++) {
-              var k = (i < 10 ? '0' : '') + i
-              newData.push({
-                  type  : 'put'
-                , key   : k
-                , value : Math.random()
-              })
-            }
-            // using sync:true here to ensure it's written fully to disk
-            db.batch(newData.slice(), { sync: true }, function (err) {
-              refute(err)
-              // we'll return here faster than it takes the readStream to complete
-            })
-          }.bind(this))
-        }.bind(this))
-      }.bind(this))
-    }
-})
\ No newline at end of file
diff --git a/test/write-stream-test.js b/test/write-stream-test.js
deleted file mode 100644
index b7a6145..0000000
--- a/test/write-stream-test.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Copyright (c) 2012-2013 LevelUP contributors
- * See list at <https://github.com/rvagg/node-levelup#contributing>
- * MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
- */
-
-var buster  = require('buster')
-  , assert  = buster.assert
-  , async   = require('async')
-  , common  = require('./common')
-
-buster.testCase('WriteStream', {
-    'setUp': function () {
-      common.commonSetUp.call(this)
-
-      this.timeout = 1000
-
-      this.sourceData = []
-
-      for (var i = 0; i < 10; i++) {
-        this.sourceData.push({
-            type  : 'put'
-          , key   : i
-          , value : Math.random()
-        })
-      }
-
-      this.verify = function (ws, db, done, data) {
-        if (!data) data = this.sourceData // can pass alternative data array for verification
-        assert.isFalse(ws.writable)
-        assert.isFalse(ws.readable)
-        async.forEach(
-            data
-          , function (data, callback) {
-              db.get(data.key, function (err, value) {
-                refute(err)
-                assert.equals(value, data.value, 'WriteStream data #' + data.key + ' has correct value')
-                callback()
-              })
-            }
-          , done
-        )
-      }
-    }
-
-  , 'tearDown': common.commonTearDown
-
-  //TODO: test various encodings
-
-  , 'test simple WriteStream': function (done) {
-      this.openTestDatabase(function (db) {
-        var ws = db.writeStream()
-        ws.on('error', function (err) {
-          refute(err)
-        })
-        ws.on('close', this.verify.bind(this, ws, db, done))
-        this.sourceData.forEach(function (d) {
-          ws.write(d)
-        })
-        ws.once('ready', ws.end) // end after it's ready, nextTick makes this work OK
-      }.bind(this))
-    }
-
-  , 'test WriteStream with async writes': function (done) {
-      this.openTestDatabase(function (db) {
-        var ws = db.writeStream()
-
-        ws.on('error', function (err) {
-          refute(err)
-        })
-        ws.on('close', this.verify.bind(this, ws, db, done))
-        async.forEachSeries(
-            this.sourceData
-          , function (d, callback) {
-              // some should batch() and some should put()
-              if (d.key % 3) {
-                setTimeout(function () {
-                  ws.write(d)
-                  callback()
-                }, 10)
-              } else {
-                ws.write(d)
-                callback()
-              }
-            }
-          , function () {
-              ws.end()
-            }
-        )
-      }.bind(this))
-    }
-
-  /*
-    // exactly the same as previous but should avoid batch() writes
-  , 'test WriteStream with async writes and useBatch=false': function (done) {
-      this.openTestDatabase(function (db) {
-        db.batch = function () {
-          Array.prototype.slice.call(arguments).forEach(function (a) {
-            if (typeof a == 'function') a('Should not call batch()')
-          })
-        }
-
-        var ws = db.writeStream({ useBatch: false })
-
-        ws.on('error', function (err) {
-          refute(err)
-        })
-        ws.on('close', this.verify.bind(this, ws, db, done))
-        async.forEachSeries(
-            this.sourceData
-          , function (d, callback) {
-              if (d.key % 3) {
-                setTimeout(function () {
-                  ws.write(d)
-                  callback()
-                }, 10)
-              } else {
-                ws.write(d)
-                callback()
-              }
-            }
-          , function () {
-              ws.end()
-            }
-        )
-      }.bind(this))
-    }
-  */
-
-    // at the moment, destroySoon() is basically just end()
-  , 'test destroySoon()': function (done) {
-      this.openTestDatabase(function (db) {
-        var ws = db.writeStream()
-        ws.on('error', function (err) {
-          refute(err)
-        })
-        ws.on('close', this.verify.bind(this, ws, db, done))
-        this.sourceData.forEach(function (d) {
-          ws.write(d)
-        })
-        ws.once('ready', ws.destroySoon) // end after it's ready, nextTick makes this work OK
-      }.bind(this))
-    }
-
-  , 'test destroy()': function (done) {
-      var verify = function (ws, db) {
-        assert.isFalse(ws.writable)
-        async.forEach(
-            this.sourceData
-          , function (data, callback) {
-              db.get(data.key, function (err, value) {
-                // none of them should exist
-                assert(err)
-                refute(value)
-                callback()
-              })
-            }
-          , done
-        )
-      }
-
-      this.openTestDatabase(function (db) {
-        var ws = db.writeStream()
-        ws.on('error', function (err) {
-          refute(err)
-        })
-        assert.isTrue(ws.writable)
-        assert.isFalse(ws.readable)
-        ws.on('close', verify.bind(this, ws, db))
-        this.sourceData.forEach(function (d) {
-          ws.write(d)
-          assert.isTrue(ws.writable)
-          assert.isFalse(ws.readable)
-        })
-        assert.isTrue(ws.writable)
-        assert.isFalse(ws.readable)
-        ws.once('ready', ws.destroy)
-      }.bind(this))
-    }
-
-  , 'test json encoding': function (done) {
-      var options = { createIfMissing: true, errorIfExists: true, keyEncoding: 'utf8', valueEncoding: 'json' }
-        , data = [
-              { type: 'put', key: 'aa', value: { a: 'complex', obj: 100 } }
-            , { type: 'put', key: 'ab', value: { b: 'foo', bar: [ 1, 2, 3 ] } }
-            , { type: 'put', key: 'ac', value: { c: 'w00t', d: { e: [ 0, 10, 20, 30 ], f: 1, g: 'wow' } } }
-            , { type: 'put', key: 'ba', value: { a: 'complex', obj: 100 } }
-            , { type: 'put', key: 'bb', value: { b: 'foo', bar: [ 1, 2, 3 ] } }
-            , { type: 'put', key: 'bc', value: { c: 'w00t', d: { e: [ 0, 10, 20, 30 ], f: 1, g: 'wow' } } }
-            , { type: 'put', key: 'ca', value: { a: 'complex', obj: 100 } }
-            , { type: 'put', key: 'cb', value: { b: 'foo', bar: [ 1, 2, 3 ] } }
-            , { type: 'put', key: 'cc', value: { c: 'w00t', d: { e: [ 0, 10, 20, 30 ], f: 1, g: 'wow' } } }
-          ]
-
-      this.openTestDatabase(options, function (db) {
-        var ws = db.writeStream()
-        ws.on('error', function (err) {
-          refute(err)
-        })
-        ws.on('close', this.verify.bind(this, ws, db, done, data))
-        data.forEach(function (d) {
-          ws.write(d)
-        })
-        ws.once('ready', ws.end) // end after it's ready, nextTick makes this work OK
-      }.bind(this))
-    }
-})
\ 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