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

connect-couchdb

v1.0.0

Published

CouchDB session store for Connect

Downloads

102

Readme

Connect CouchDB

connect-couchdb is a storage wrapper for the express-session middleware of connect/ expressjs frameworks. Build Status

Requirements

  • couchdb (tested with v1.5.0)
  • yacw 0.2.x : the couchdb wrapper. Should be easy to use another one.
  • mocha (only for tests)

Compatibility

For node v0.10, Connect v3 and Express v4 you must use the master branch. For olders node version, use others branches.

Installation

Via npm:

$ npm install connect-couchdb --save

Usage

var session = require('express-session'),
    connect = require('connect');
    ConnectCouchDB = require('connect-couchdb')(session);

var store = new ConnectCouchDB({
  // Name of the database you would like to use for sessions.
  name: 'myapp-sessions',

  // Optional. How often expired sessions should be cleaned up.
  // Defaults to 600000 (10 minutes).
  reapInterval: 600000,

  // Optional. How often to run DB compaction against the session
  // database. Defaults to 300000 (5 minutes).
  // To disable compaction, set compactInterval to -1
  compactInterval: 300000,

  // Optional. How many time between two identical session store
  // Defaults to 60000 (1 minute)
  setThrottle: 60000
});
var server = connect();
server.use(session({secret: 'YourSecretKey', store: store });

If the database specified doesn't already exist you have to create it with tools/ files. Run following command to create database, populate with the design document and setup the CouchDB database specific option _revs_limit :

$ node tools/setup.js <database_name> <revs_limit> [username] [password]

For more informations about the _revs_limit option, read this.

It is highly recommended that you use a separate database for your sessions for performance of both the session views and any other document views you may have.

See example.js file for an example connect server using connect-couch.

Updating

Please invoke the tool to create the design documents when updating to insure you are using the last version of the view.

$ node tools/put_design_docs.js <database_name> [username] [password]

Tests

$ npm test

Author

Contributors

$ git shortlog -s -n