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

configpig

v0.1.0

Published

TypeScript SDK for ConfigPig — managed config file registry for teams

Readme

ConfigPig — TypeScript SDK

TypeScript SDK for ConfigPig, a managed config file registry for teams.

Installation

npm install configpig

Configuration

Set environment variables or pass directly to the client:

export CONFIGPIG_API_KEY="sk-api01-your-key-here"
export CONFIGPIG_URL="https://configpig.com"  # optional, this is the default

Quick Start — getConfig()

The simplest way to use ConfigPig. One function, no boilerplate:

import { getConfig } from "configpig";

// Fetch a config
const content = await getConfig("my-config");

// With a specific label
const content = await getConfig("my-config", { label: "production" });

// With format conversion
const content = await getConfig("my-config", { outputFormat: "yaml" });

// With a fallback if the service is unreachable
const content = await getConfig("my-config", { fallback: '{"default": true}' });

// With TTL caching (seconds)
const content = await getConfig("my-config", { ttl: 300 });

Set global defaults so you don't repeat yourself:

import { configure } from "configpig";

configure({
  apiKey: "sk-api01-...",
  baseUrl: "https://configpig.com",
  defaultLabel: "latest",
  defaultTtl: 300,
});

Using the Full Client

For advanced use cases (creating configs, managing versions, labels, etc.):

import { Client } from "configpig";

const client = new Client();

// List all configs
const result = await client.listConfigs();
if (result.ok) {
  for (const cfg of result.data!) {
    console.log(`${cfg.slug}: ${cfg.name}`);
  }
}

// Get a specific config
const result = await client.getConfig("my-config");
if (result.ok) {
  console.log(result.data!.name);
}

// Fetch config content with optional format conversion
const result = await client.fetch("my-config", { label: "latest", outputFormat: "yaml" });
if (result.ok) {
  console.log(result.data!.content);
}

// Create a new config
const result = await client.createConfig({
  name: "App Settings",
  slug: "app-settings",
  content: '{"debug": false, "log_level": "info"}',
  format: "json",
  tags: ["app"],
});

// Create a new version
const result = await client.createVersion("app-settings", {
  content: '{"debug": false, "log_level": "warn"}',
  changeNote: "Changed log level to warn",
});

// Promote a version to a label
const result = await client.promote("app-settings", { version: 2, label: "production" });

API Reference

All methods return APIResponse<T> with fields:

  • ok: boolean — whether the request succeeded
  • statusCode: number — HTTP status code
  • data?: T — response data (when ok is true)
  • error?: string — error message (when ok is false)

Configs

| Method | Description | |---|---| | listConfigs(options?) | List all configs | | getConfig(slug) | Get config details | | createConfig(options) | Create a new config | | updateConfig(slug, options) | Update config metadata | | deleteConfig(slug) | Delete a config |

Versions

| Method | Description | |---|---| | listVersions(slug) | List all versions | | getVersion(slug, versionNumber) | Get specific version | | createVersion(slug, options) | Create a new version |

Fetch

| Method | Description | |---|---| | fetch(slug, options?) | Fetch config content with optional format conversion |

Labels

| Method | Description | |---|---| | listLabels() | List team labels | | createLabel(options) | Create a team label | | deleteLabel(name) | Delete a team label | | listConfigLabels(slug) | List labels for a config | | assignLabel(slug, options) | Assign label to version |

Promote / Rollback

| Method | Description | |---|---| | promote(slug, options) | Assign label to a version | | rollback(slug, options) | Rollback label to previous version |

Exports

| Method | Description | |---|---| | listExports() | List exports | | createExport(options) | Create an export | | getExport(exportId) | Get export details | | deleteExport(exportId) | Delete an export |

System

| Method | Description | |---|---| | healthCheck() | Check API health |

License

MIT — Bright Wing Solutions LLC