scratchdb
Version:
A ephemeral CouchDB-like database
63 lines (41 loc) • 1.35 kB
Markdown
# scratchdb
[![Build Status][travis-image]][travis-url]
[travis-image]: https://img.shields.io/travis/tlvince/scratchdb.svg
[travis-url]: https://travis-ci.org/tlvince/scratchdb
> A ephemeral CouchDB-like database
```js
'use strict'
var scratchdb = require('scratchdb')
function done (server) {
console.log('scratchdb running on port', server.address().port)
// => scratchdb running on port 5985
}
scratchdb(done)
```
Useful when you just want to spin up a throwaway CouchDB instance; no
Futon/Fauxton, no auth, no persistence.
You should probably use [pouchdb-server][] when you need more.
[pouchdb-server]: https://github.com/pouchdb/pouchdb-server
## Usage
### API
```js
scratchdb([callback[, opts]])
```
A [net.Server][] instance is passed to (an optional) `callback` when the server
has been bound.
Additionally, pass an `opts` object to configure the server [options][].
### CLI
```shell
[PORT] scratchdb
# scratchdb running at http://0.0.0.0:5985
```
[options]: #options
[net.Server]: https://nodejs.org/api/net.html#net_class_net_server
## Options
Option | Description | Default
------ | ----------- | -------
`port` | The port scratchdb binds to | `5985`
## Author
© 2015 Tom Vincent <npm@tlvince.com>
## License
Released under the [MIT License](http://tlvince.mit-license.org).