Socket
Book a DemoInstallSign in
Socket

connect-mongoskin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-mongoskin

Connect's durable sessions middleware backed by MongoSkin

0.1.2
latest
Source
npmnpm
Version published
Weekly downloads
21
2000%
Maintainers
1
Weekly downloads
 
Created
Source

MongoSkin Session Store

Simple Session Store for Connect() Framework session Middleware that leverages an existing connection from MongoSkin

Motivation

We were using a connect-mongodb which was working great, however we want to keep our connection pool centralized, have the benefits that an abstraction layer like mongoskin provides and avoid going twice through the pain of getting our ReplSetCluster configuration in place.

Installation

Use git clone to download the source and make it available in your project wirh npm link.

or

npm install connect-mongoskin

Usage

This session store is build to work with Connect() Framework / ExpressJS() Framework / RailwayJS() Framework Use it like any other middleware.

Abstract example

The lib reuses an existing client, so pass in the SkinDb and options if needed.

var SkinStore = new SkinStore(`db`, `options`[, callback]);

Connect() / ExpressJS() Example

var express    = require('express'),
    db = require('mongoskin').db(`your_connection_here`),
    SkinStore = require('connect-mongoskin');

var app = express.createServer();
app.use(express.cookieParser());
app.use(express.session({cookie: { secure: false, maxAge:86400000 }, store: new SkinStore(`db`)})); 

Meta

Originally written by @johnnyhalife (johnny at mural.ly)

Keywords

connect

FAQs

Package last updated on 02 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.