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

clerk

v0.8.3

Published

CouchDB library for Node and the browser

Downloads

4,497

Readme

clerk Build Status

var clerk = require('clerk');

var client = clerk('http://127.0.0.1:5984');
var db = client.db('test');

db.info(function (err, info) {
  console.log(err || info);
});

// if a Promise implementation is available, you may leave out the callback
var promise = db.info()
promise.then(function (info) {
  console.log(info);
}).catch(function (err) {
  console.log(err);
});

Documentation

Full documentation at http://mikepb.github.io/clerk/

For more information about promises, see this Mozilla documentation.

Installation

$ npm install clerk

Browser Support

Browser support is provided by superagent. The browser versions of the library may be found under the dist/ directory. The browser files are updated on each versioned release, but not for development. Modern browsers are generally supported, but not widely tested. Karma is used to run the mocha tests in the browser.

Security restrictions on cross-domain requests currently limits the usefulness of the browser version. Using a local proxy or configuring Cross-Origin Resource Sharing in CouchDB may allow you to use the library in the browser. Please see the configuration notes in the testing section for more information about CouchDB CORS support.

To build the client files:

$ npm run dist

Testing

To run tests in node:

$ npm test

To run tests with Karma, make sure that you have enabled cors in CouchDB. By default, CouchDB does not allow the Authorization header, so if you will be authenticating, you'll need to add it to the list as well.

[httpd]
enable_cors = true

[cors]
credentials = true
origins = *
headers = Accept, Accept-Language, Authorization, Content-Length, Content-Range, Content-Type, Destination, Expires, If-Match, Last-Modified, Origin, Pragma, X-Requested-With, X-Http-Method-Override

Then, you may run Karma:

$ npm run karma

Philosophy

The philosophy of clerk is to provide a thin wrapper around the CouchDB API, making the database easier to use from JavaScript. clerk is designed to quickly allow you to get started with CouchDB, while still giving you full access to CouchDB's more advanced features.

The library API generally follows the RESTful API, so you can use the CouchDB docs as well as the clerk docs to build your applications. If a feature is missing from clerk or you need to access more advanced features, the request method allows you to send custom requests directly to CouchDB.

License

Copyright 2012-2015 Michael Phan-Ba <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.