🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

connect-ml

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-ml

MarkLogic session store for Connect

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
11
-8.33%
Maintainers
1
Weekly downloads
 
Created
Source

connect-ml

MarkLogic session store for Express and Connect. Also you can use it with Koa

MarkLogic session store is a provision for storing session data as json in MarkLogic Server

Compatibility

  • Supports Express >= 4.x and Connect >= 1.4.0 through express-session
  • Supports Node.js >= 0.10 and io.js
  • Indirectly supports Koa >= 0.9.0 through express-session

Getting Started

Installation

$ npm install connect-ml
  • prefix The directory where the session files will be stored. Defaults to /sess/
  • client The marklogic DatabaseClient instance.
  • logErrors The function for logging errors
  • ttl Session time to live in seconds. Defaults to 86400 (24 hours)

Usage

Express or Connect integration

Due to express >= 4 changes, we need to pass express-session to the function connect-ml exports in order to extend session.Store:

var session = require('express-session');
var marklogic = require('marklogic');
var MlStore = require('connect-ml')(session);
var db = marklogic.createDatabaseClient(connInfo);

app.use(session({
    store: new MlStore({
        client: db
    }),
    secret: 'keyboard cat',
    resave: true,
    saveUninitialized: true
}));

FAQs

Package last updated on 12 Oct 2016

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