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

@promptforgee/registry

v0.1.4

Published

PromptForge registry package

Readme


Why this package exists

Prompts are an essential part of your application's logic, yet they are often scattered across files as raw strings. When prompts change, it's hard to track versions, rollback regressions, or share them across teams.

@promptforgee/registry provides a dedicated storage system for @promptforgee/core Prompt instances. It automatically handles version bumping, querying, and serialization, allowing you to treat your prompts as versioned assets.

Features

  • Automatic Versioning: Saving a prompt with an existing name automatically increments its version.
  • Tagging & Searching: Organize and retrieve prompts based on semantic tags.
  • Adapter Pattern: Easily swap storage backends (e.g., in-memory for testing, database for production).
  • Serialization: Import and export your entire prompt registry to JSON seamlessly.

Installation

# npm
npm install @promptforgee/registry @promptforgee/core

# pnpm
pnpm add @promptforgee/registry @promptforgee/core

# yarn
yarn add @promptforgee/registry @promptforgee/core

# bun
bun add @promptforgee/registry @promptforgee/core

Quick Start

import { Prompt } from '@promptforgee/core';
import { PromptRegistry, InMemoryAdapter } from '@promptforgee/registry';

async function main() {
  // Initialize the registry with an in-memory store
  const registry = new PromptRegistry(new InMemoryAdapter());

  const myPrompt = Prompt.create().task('Write a greeting message.');

  // Save version 1
  await registry.save('greeting-prompt', myPrompt, ['onboarding']);

  // Modify and save version 2
  const updatedPrompt = myPrompt.task('Write a warm, professional greeting message.');
  await registry.save('greeting-prompt', updatedPrompt, ['onboarding']);

  // Load the latest version
  const loadedPrompt = await registry.load('greeting-prompt');

  console.log(loadedPrompt?.getState().task);
  // Outputs: "Write a warm, professional greeting message."
}

main();

API Overview

PromptRegistry

The main interface for interacting with saved prompts.

| Method | Description | | ----------------------------- | --------------------------------------------------------------------------------------------------- | | new PromptRegistry(adapter) | Initializes the registry. Defaults to InMemoryAdapter. | | .save(name, state, tags) | Saves a Prompt or PromptState. Auto-increments version if name exists. | | .load(name, version?) | Retrieves a specific version, or the latest if no version is provided. Returns a Prompt instance. | | .search(query) | Searches the registry by tags or name. | | .exportToJSON() | Exports all records to a serialized JSON string. | | .importFromJSON(json) | Imports records from a serialized JSON array. |

Adapters

  • InMemoryAdapter: A fast, memory-based storage engine ideal for local development, testing, or serverless cold starts.
  • (More adapters for Redis, PostgreSQL, and DynamoDB are planned)

Real-world Example

Exporting your prompts to disk during a CI build step for deployment:

import { PromptRegistry } from '@promptforgee/registry';
import * as fs from 'fs';

async function buildPromptBundle(registry: PromptRegistry) {
  // Export all versioned prompts
  const jsonBundle = await registry.exportToJSON();

  // Save to disk to be bundled with the application
  fs.writeFileSync('./dist/prompts.json', jsonBundle);
  console.log('Successfully bundled all prompts!');
}

Ecosystem

@promptforgee/registry is the storage layer for the PromptForge ecosystem.

@promptforgee/core (Builds the prompt) ↓ @promptforgee/analyzer (Analyzes the prompt) ↓ @promptforgee/optimizer (Optimizes the prompt) ↓ @promptforgee/registry (You are here)

Documentation

For full documentation and advanced usage, visit promptforge.dev/docs/registry.

Examples

Check out our Examples directory for more real-world use cases.

Roadmap

  • 🚧 RedisAdapter for distributed prompt storage.
  • 🚧 PostgresAdapter for persistent relational storage.
  • 🚧 A/B Testing hooks to track prompt performance metrics.

Contributing

We welcome contributions! Please read our Contributing Guide to get started.

License

MIT © Omnikon-Org