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

mniam-store

v4.0.0

Published

session store for connect middleware using mniam mongo access layer

Downloads

13

Readme

NPM version Build Status Dependency Status

Mniam Store

mniam-store is a connect session store backed by mongodb

mniam is used to access as a access layer which means no async on init, simple configuration and seamless connection sharing if your app is using DB

mniam-store is compatible with express-session middleware

Installation

  $ npm install mniam-store

Options

  • db existing database created with mniam (can be shared with other parst of the app)
  • collection name of the mongo collection to keep sessions in (default: sessions)
  • maxAge - (seconds) specifies how long sessions should stay in DB - should be set-up to a value slightly larger than cookie.maxAge - defaults to 1 day

Usage

Similar to other connect session stores.

var connect = require('connect');
var mniam = require('mniam');
var MniamStore = require('mniam-store')(connect);

// use DB for mniam store only or share it with other parts of the app
var db = mniam.db('mongourl://localhost/database');

connect().use(connect.session({
  store: new MniamStore({
    db: db
  })
}));

Upgrading from 0.x

Since mniam-store is using mongo TTL index sessions created with previous versions will not expire automatically. We need to time stamp old sessions after the upgrade:

db.sessions.update(
  {_mod: {$exists:0}},
  {$currentDate:{_mod:true}},
  {multi:true}
);

And drop old index in expires:

db.sessions.dropIndex({expires:1});

License

MIT