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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rm-session-populator

v2.3.2

Published

This Middleware is designed to work in NodeJS Express Backends with the rm-authenticator and a Front-End that is connected to that Authenticator as well.

Downloads

118

Readme

RM-SESSION-POPULATOR

This Middleware is designed to work in NodeJS Express Backends with the rm-authenticator and a Front-End that is connected to that Authenticator as well.

Docker - rm-authenticator
GitHub - rm-authenticator

When the Front-End sends you a request containing a session cookie, the middleware will automatically populate the request Object with a user Property containing all the user information

Installation

  npm install --save rm-session-populator

Use

You configure the Session Populator with the Options Object. This has several possible Settings

authenticatorHost Hostname where your rm-authenticator is running. By default it's http://localhost:8081

authenticatorUserPath: The path to the endpoint where userinfo is stored. By default it uses the authenticators default /auth/userinfo

credentialsCookieName:: The Name of the Session Cookie. Defaults to connect.sid

rejectWithoutAuthentication: Determines the behaviour of the middleware. If set to true (which it is by default) it will automatically reject any request made to the backend as unauthorized that is missing a cookie and web token. If it is set to false it will poplulate the user property with null

jwtMode: defaults to direct. If set to direct JWT will use the secret provided with the jwt Secret option to verify your web token. If set to key it will use the public key from a file

jwtSecret: Only has to be set if jwtMode is direct. The secret will be used to verify the web token if present. You will have to set the same Secret in the Authenticator.

jwtKeyLocation: Only needs to be set if jwtMode is key. Points to the Public Key in the file system. Defaults to /data/public_key.pem

jwtHeaderName: Session Populator will by default look for the Bearer token in the "Authorization" Header. If you want to use another header, you can change this here.

To implement the middleware do the following

JavaScript

const express = require("express");
const cookieParser = require("cookie-parser");
const sessionPopulate = require("rm-session-populator");
const app = express();

app.use(cookieParser());
app.use(express.json());
app.use(
  sessionPopulate({
    authenticatorHost: "https://my-own-host:443",
    rejectWithoutAuthentication: false,
    jwtMode: "key",
    // jwtSecret: "superSecret",
    jwtKeyLocation: "/data/privateKey.pem",
  })
);

TypeScript

import express from "express";
import cookieParser from "cookie-parser";
import sessionPoplulate from "rm-session-populator";

const app = express();

app.use(cookieParser());
app.use(express.json());
app.use(
  sessionPopulate({
    authenticatorHost: "https://my-own-host:443",
    rejectWithoutAuthentication: false,
    jwtMode: "key",
    // jwtSecret: "superSecret",
    jwtKeyLocation: "/data/privateKey.pem",
  })
);