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

aerospike-session-store

v0.4.0

Published

Aerospike session store for Express.js session middleware

Downloads

83

Readme

Aerospike Express Session Store travis codecov npm

The Aerospike Express Session Store is an implementation of the Express.js session store that uses Aerospike as the persistence layer for sessions. The session middleware for Express is provided by the session-express module. Aerospike DB is a high-performance NoSQL key-value store: www.aerospike.com.

Installation

Via npm:

$ npm install aerospike-session-store

Usage

Initialization

Pass the express-session store into aerospike-session-store to create an AerospikeStore constructor. Then use that constructor to create a new store instance:

const session = require('express-session')
const AerospikeStore = require('aerospike-session-store')(session)

var app = express()
app.use(session({
  secret: '123456789QWERTY',
  store: new AerospikeStore({
    namespace: 'express',
    set: 'session',
    ttl: 86400, // 1 day
    hosts: '10.0.0.1:3000,10.0.0.2:3000'
  }),
  resave: false,
  saveUninitialized: false
}))

Options

The session store requires an Aerospike Client instance to connect to the DB cluster. An existing client instance can be passed in using the client option. Otherwise, the session store will create it's own client instance. The Aerospike session store can be initialized with a number of optional parameters:

  • client - An existing Aerospike client instance that the session store should use instead of creating it's own instance.
  • namespace - The Aerospike namespace to be used for session storage. (default: 'test')
  • set - The Aerospike set name used when creating session records. (default: 'express-session')
  • ttl - Time-to-live in seconds for the session records created in the Aerospike db. If not specified, the ttl will be determined based on the maxAge of the session cookie, if any. Set ttl to zero to disable usage of ttl. However, note that a default ttl at the namespace level might still apply.
  • mapper - A custom data mapper to convert session objects to/from a format suitable for storage in an Aerospike record. By default, the JSON module is used to serialize session objects to/from JSON format.

Additional options are passed on to the Aerospike client when creating a new client instance (i.e. unless the client paramter is used.) Please refer to the client's API documentation for a detailed list of supported paramters.

License

The Aerospike Express Session Store is made availabled under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.