loveseat

0.0.11 • Public • Published

loveseat

Build Status

Sometimes you don't need the whole couch.

usage

var Loveseat = require('loveseat').Loveseat,
    db = new Loveseat({ db: 'mydb' });
 
db.insert({ name: 'My Document' }, function (err, res) {
  console.log(res);
});

other options

when making a new Loveseat, available options are:

  • db: the name of the db, defaults to "test"
  • url: the url to the couchdb, defaults to "http://localhost:5984/" and should be in that format if customized.

API

  • db.insert([ id,] document [, callback]) Insert (or update) a document with optional id
  • db.destroy(id, rev [, callback]) Delete document with id, revision rev
  • db.get(id [, callback]) Get document by id
  • db.create([callback]) Creates the database if it does not already exist
  • db.check([callback]) Checks for the presence of your selected db
  • db.makeRequest(method[, url, data, callback) Build a manual request to the couch.

All callbacks are of form (err, res) where res is the JSON-parsed response from couch.

license

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.11
    0
    • latest

Version History

Package Sidebar

Install

npm i loveseat

Weekly Downloads

7

Version

0.0.11

License

MIT

Last publish

Collaborators

  • jarofghosts