npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

couchdown

v1.2.1

Published

A leveldown backend for couchdb

Downloads

37

Readme

js-standard-style Build Status Coverage Status

CouchDown

A LevelDOWN compliant backend built on top of Abstract-LevelDOWN using Apache CouchDB as the backend.

Installation

npm i -S couchdown

Usage

var levelup = require('levelup')
var CouchDown = require('couchdown')

var db = levelup('http://localhost:5894/db', {db: CouchDown})

Auth!

This module passes authentication details via the auth section of the URL. This means if you're talking to a couch server over a public, non-encryped connection your auth details will be in the open. But why are you communicating over HTTP to a database on a public network anyway...

CouchDB and _rev

Using the batch operation can be hazardous!

If you are using the #batch operation, using valueEncoding: json and not setting wrapJSON: true in your constructor, using #batch requires some additional attention! Once you've put your document, you must #get the object again from the server to update the _rev property on the object. Failure to do so will result in all subsequent #put operations to fail with a document mis-match!

CouchDB and JSON

Since CouchDB is a JSON store, non-JSON values will be wrapped in a JSON object transparently for the user. This will add some additional overhead to #put and #del operations though since it will have to make a HEAD request to the server first to find out what the latest version of the document is before it can perform the operation. If you're looking for a very performant way to store non-JSON values, this is likely not the best solution for you.

JSON values, however, are by default, not wrapped. This means you will receive the _id and _rev keys when you #get objects out of the store. If you provide {wrapJSON: false} as an option when you're creating the levelup instance, your JSON will be wrapped by another JSON object, so your data will not be polluted.

CouchDB and utf16le or ucs2 encoded keys

There are two tests in encoding.spec.js that are marked {skip: true} -- one for keys that have keyEncoding: 'utf16le' and one for keys that have keyEncoding: 'ucs2'. Couch does not seem to like these encodings when you get to do an HTTP GET request, so they've been commented out.

LICENSE

Copyright © 2015 Scripto, Use under the Apache-2.0 license. See LICENSE for details