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

fahren

v0.1.0-alpha.0

Published

Fahren is a toolkit for implementing multi-tenant strategies at both the application and infrastructure level.

Readme

Fahren

Fahren is a toolkit for implementing multi-tenant strategies at both the application and infrastructure level.

Using Fahren

Fahren exposes two intuitive APIs that help you separate tenant management from tenant usage:

import Postgres from "@fahren/postgres";

// Choose isolation strategy
const postgres = new Postgres().withDatabaseIsolation();

// Management API for provisioning
const management = postgres.forManagement();
await management.createTenant("tenant123");

// Tenant-aware API
const tenants = postgres.forTenants();
const result = await tenants.queryAs("tenant123", "SELECT * FROM orders");

This separation creates a clear boundary between provisioning (e.g. databases, roles, Redis namespaces, etc.) and tenant-aware operations, so each part of your app/service does exactly what it needs to, and nothing more.

Highlights

  • Management
    Automates tenant logical resources with:
    • management.createTenant(tenantId) to provision all necessary logical resources
    • management.deleteTenant(tenantId) to clean up completely when needed.
  • Tenants
    Wraps infrastructure clients like Postgres or Redis with built-in tenant logic, so you don’t need to reinvent the wheel.

Built-in Security Practices

Fahren takes a gradual approach to security. Light isolation strategies require minimal setup. Stronger isolation (like database-per-tenant) integrates with secret managers like AWS Secrets Manager or Vault to store tenants sensitive information. The library makes these requirements explicit, guiding you to the right level of security for your use case.

Installation

# Install specific resource packages as needed
npm install @fahren/postgres @fahren/redis

# Using yarn
yarn add @fahren/postgres @fahren/redis

# Using pnpm
pnpm add @fahren/postgres @fahren/redis

Resources

In Fahren, resources are infrastructure components that support at least one multi-tenant strategy, such as Postgres or Redis. Resources require at least one isolation strategy to determine how tenants remain secure and isolated.

Supported Databases

  • Postgres - Row-Level Security (RLS), schema, and database-based isolation
  • Redis - Prefix and ACL-based isolation with secrets management

Usage Examples

Postgres with Row-Level Security (RLS)

import Postgres from "@fahren/postgres";

const postgres = new Postgres().withRlsIsolation();
const connectionOptions = {
  connectionString: "postgres://user:password@host:5432/db",
};

const management = postgresResource.forManagement(connectionOptions, {
  autoSetup: true, // Automatically sets up RLS policies when first tenant is created
});
await management.createTenant("acme-inc");

const tenants = postgres.forTenants(connectionOptions);
const result = await tenants.queryAs(
  "acme-inc",
  "SELECT SUM(cost) FROM orders;"
);

Redis with ACL

For tight isolation levels that require tenant-specific credentials, Fahren integrates with secrets providers to store and retrieve sensitive fields.

import Redis from "@fahren/redis";
import { AwsSecretsManager } from "@fahren/secrets";

const redisManagement = new Redis()
  .withAclIsolation()
  .forManagement({ secrets });
await redis.createTenant("tenant123");

const redisTenants = new Redis().withAclIsolation().forTenants({ secrets });
const tenantRedisClient = redisTenants.getClientFor("tenant123");
await tenantRedisClient.set("key", "value");

Examples

For complete multi-tenant application examples, visit the examples folder.

API Reference

For detailed API documentation of each resource, refer to the specific package documentation: