rvagg/node-levelup — pull request #208 by rvagg (2013-10-14 11:04:23+00:00)
Title: optional location & options arguments

ref #206 as per @mmalecki's suggestion

This gives two new constructor forms: **levelup(options[, callback ])** and **levelup(db[, callback ])**.

If you don't provide a `location` argument but do provide an `'object'` as your first argument then it must have a `'db'` property that's a `'function'` which is assumed to be a backend factory; otherwise it fails. The second form is where you don't provide a `location` argument but you do provide a `'function'` as your first argument, this is assumed to be a back-end factory. In both cases a second argument is allowable, a callback `'function'` but this is optional. We can't do a form where you provide a `location` as the first argument and a back-end factory as the second because we can't tell if it's supposed to be a factory or a callback, unless you provide a callback as well, but then, you're getting verbose anyway so it's just silly.

```js
var levelup = require('levelup')
var memdown = require('memdown')

var db = levelup({ db: memdown })

// or

var db = levelup(memdown)
```

required new DeferredLevelDOWN and MemDOWN releases to make the `location` optional.