Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coux

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coux

Minimum viable CouchDB client, really just JSON and REST

  • 0.1.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Coux, pronounced "Couch"

Coux is the least amount of CouchDB client I can imagine. It doesn't do much, but it is relaxing.

Usage

The only thing worth noting is that for coux, arrays are a perfectly good way to specify paths. And it'll do the URL encoding for you.

var db = "http://jchris.iriscouch.com/foobar";

// Get database info:
coux(db, function(err, info) {
  console.log(info)
})

// Get a document:
coux([db, "mydocid"], function(err, doc) {
  console.log(doc)
  // Update a document:
  doc.updated_by = "yours truly";
  coux.put([db, "mydocid"], doc, function(err, ok) {
    console.log(ok)
  })
})

// Create a document letting the server assign the id:
var newDoc = {foo : "bar"};
coux.post(db, , function(err, ok) {
  console.log(ok)
  
  // Delete a document without sending the doc body
  coux.del([db, ok.id, {rev : ok.rev}], function(err, ok) {
    console.log(ok);
  })
})

Enjoy!

FAQs

Package last updated on 05 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc