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

@checkgate/cli

v0.1.22

Published

Checkgate command-line tools — generate type-safe flag accessors for TypeScript, Dart, and Rust from your flag definitions.

Readme

Stop hard-coding flag keys as loose strings. checkgate typegen reads your flag definitions — straight from a running server or a local JSON export — and emits a typed module so a wrong key or a mis-typed value is a compile error, not a production surprise.

Installation

npm install -g @checkgate/cli
# or run without installing:
npx @checkgate/cli typegen --help

Requires Node 18+ (uses the built-in fetch). Zero runtime dependencies.

Usage

checkgate typegen --lang <langs> [source] [output]

Pick a source

From a running server, authenticated with a personal access token (or SDK key):

checkgate typegen --lang ts \
  --url http://localhost:3000 \
  --env <environment-id> \
  --token <personal-access-token> \
  --out src/flags.ts

Or from a local JSON file (e.g. a /flags API export), which needs no network — ideal for CI:

checkgate typegen --lang ts,dart,rust --input flags.json --out-dir ./generated

Server connection details can also come from the environment: CHECKGATE_URL, CHECKGATE_ENV, CHECKGATE_TOKEN.

Options

| Flag | Alias | Description | |---|---|---| | --lang | -l | ts|typescript, dart, rust|rs. Comma-separate for several. | | --input | -i | Read flags from a local JSON file instead of the API. | | --url | -u | Server base URL (CHECKGATE_URL). | | --env | -e | Environment id to read (CHECKGATE_ENV). | | --token | -t | Personal access token / SDK key (CHECKGATE_TOKEN). | | --out | -o | Write to a file (single language); omit to print to stdout. | | --out-dir | | Write flags.<ext> per language (required for multiple languages). | | --help | -h | Show help. | | --version | | Show version. |

What it generates

Given a boolean new-dashboard, a string checkout-color, an integer max_items, and a JSON theme-config:

TypeScript

export type FlagKey = "new-dashboard" | "checkout-color" | "max_items" | "theme-config"

export interface FlagValueTypes {
  "new-dashboard": boolean
  "checkout-color": string
  "max_items": number
  "theme-config": unknown
}

export const FLAG_DEFAULTS = { /* each flag's configured default */ }

export function typedFlags(client: CheckgateLike) { /* … */ }

Wrap your existing client for compile-time-checked keys and correctly-typed values:

import { CheckgateClient } from '@checkgate/node'
import { typedFlags } from './flags'

const flags = typedFlags(new CheckgateClient({ /* … */ }))

const color = flags.getValue('checkout-color', userId) // typed as string
flags.getValue('chekout-color', userId)                // ❌ compile error — typo caught

Dart

A FlagKey enum, a kFlagDefaults map, and a TypedFlags wrapper with one strongly-typed getter per flag:

final flags = TypedFlags(checkgate);
final String color = flags.checkoutColor(userId);

Rust

A FlagKey enum (as_str(), ALL, Display) plus a defaults module of typed constants — dependency-free (json flags' defaults are emitted as raw JSON string constants):

let key = FlagKey::CheckoutColor.as_str(); // "checkout-color"
let fallback = defaults::CHECKOUT_COLOR;   // "blue"

Notes

  • Output is deterministic — flags are sorted by key, so regenerating produces clean diffs. Regenerate in CI and check the result in, or fail the build on drift.
  • Archived flags are excluded. Flags without a configured default_value fall back to a type-appropriate zero value (false / "" / 0 / null).
  • Keys that aren't valid identifiers (hyphens, leading digits) are converted safely and de-duplicated per language.

Part of Checkgate — the self-hosted feature-flag platform.