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

launchdarkly-node-server-sdk-memory

v0.1.0

Published

In-memory persistent feature store for LaunchDarkly Node.js server SDK

Readme

In-Memory Feature Store for LaunchDarkly Node SDK

A simple, in-memory implementation of the LaunchDarkly feature store interface for the Node.js server SDK.

Overview

This package provides InMemoryFeatureStore, a persistence layer for the LaunchDarkly Node.js server SDK that stores feature flags in memory. It's useful for:

  • Testing - No external dependencies, fast, isolated
  • Development - Quick iteration without database setup
  • Single-instance apps - When you don't need distributed caching

Installation

npm install launchdarkly-node-server-sdk-memory @launchdarkly/node-server-sdk

Quick Start

import { init } from '@launchdarkly/node-server-sdk';
import { createInMemoryStore } from 'launchdarkly-node-server-sdk-memory';

const store = createInMemoryStore();
const client = init('sdk-key', {
  featureStore: store,
});

await client.waitForInitialization();
const flag = client.variation('flag-key', context, false);

API

InMemoryFeatureStore

Implements the LDFeatureStore interface with the following methods:

all(kind, callback)

Retrieves all items of a given kind (excluding deleted items).

get(kind, key, callback)

Retrieves a single item by kind and key. Returns undefined if not found or deleted.

upsert(kind, item, callback)

Adds or updates an item with version-based conflict resolution. Only replaces if incoming version > stored version.

delete(kind, key, version, callback)

Soft deletes an item by marking it as deleted: true. Only deletes if incoming version > stored version.

init(allData, callback)

Initializes the store, completely replacing existing data.

initialized(callback)

Checks whether the store has been populated with data.

close()

Cleanup method (no-op for in-memory store).

getDescription()

Returns "In-memory feature store".

getInitMetaData()

Returns metadata about the store.

Features

  • Full LDFeatureStore compliance - Implements all required methods
  • Version conflict resolution - Higher versions always win
  • Soft delete pattern - Deleted items are excluded from queries
  • Multiple kinds - Supports features, user segments, contexts, etc.
  • Synchronous callbacks - Calls callbacks immediately (no setImmediate)
  • TypeScript support - Full type definitions included

Limitations

⚠️ This store is not suitable for:

  • Multi-instance deployments (no persistence across restarts)
  • High-traffic applications (not optimized for performance)
  • Production use cases requiring data durability

For production, use @launchdarkly/node-server-sdk-redis, PostgreSQL, or other persistent stores.

Testing

npm test
npm run test:watch

All 20+ tests pass, covering:

  • CRUD operations
  • Version conflict resolution
  • Soft delete behavior
  • Initialization
  • Multiple kinds
  • Edge cases

License

Apache License 2.0