node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


connect-nano Build Status

Provide req.nano, passing session cookies to CouchDB and back again.

Getting Started

Install the module with: npm install connect-nano

var connect = require('connect');
var nano = require('connect-nano');
var app = connect()
  .use(connect.cookieParser())  // connect-nano depends on cookieParser 
  .use('/login', function(req, res) {
      method: 'post',
      path: '_session',
      content_type: 'application/x-www-form-urlencoded; charset=utf-8'
  .use('/session', function(req, res) {
    req.nano.request({ path: '_session' }).pipe(res);
  .use('/me', function(req, res) {
    req.nano.request({ path: '_session' }, function(err, data) {
      if (err) {
        return res.end(err);
      req.nano.use('_users').get('org.couchdb.user:' +;


connect-nano passes configuration directly over to nano(), see nano configuration.


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

  • Lint your code via npm run jshint.
    • And test your code with nodeunit via npm test.


Copyright (c) 2013 null2 GmbH, Johannes J. Schmidt
Licensed under the MIT license.