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

@moshevents/flags

v0.8.0

Published

Mosh — single source of truth for the feature-flag / remote-config registry. Typed `Flags` for web/admin; iOS consumes the SwiftPM target.

Readme

mosh-flags

Single source of truth for the feature-flag / remote-config registry across web, admin, and iOS — the third SSOT alongside mosh-tokens and mosh-copy. Same pattern: one hand-edited source → a dependency-free generator → typed per-platform outputs.

This repo owns the schema (which flags exist, their types, defaults, owners). The values are resolved at runtime by the backend.

What's generated

flags.jsonnpm run build

  • Sources/MoshFlags/Flags.swift — iOS: Flags.<key> as a typed FlagKey<T> with the default baked in.
  • dist/flags.ts — web/admin: typed Flags registry, FlagKey union, FLAG_DEFS (for backend seeding).
  • dist/flags.md — human/ops view: a table of every flag.

FlagKey.swift is hand-written (the typed key + FlagResolving protocol); Flags.swift is generated.

Add a flag

  1. Add an entry under flags in flags.json:
    "newCheckoutEnabled": { "type": "bool", "default": false, "description": "...", "owner": "platform" }
    • typebool | string | int | double
    • default MUST be safe to ship if the backend is down. For kill-switches, default true (feature stays ON until explicitly killed).
    • keys are lowerCamel and stable — renaming a key is a new flag.
  2. npm run build (regenerates all three outputs).
  3. Backend seeds/validates against the registry; clients reference Flags.newCheckoutEnabled.

Flags are temporary — once a rollout is 100% and durable, fold the behavior in and delete the flag.

How the full system fits (v1: operational gating + % rollout)

flags.json (this repo, the registry/contract)
      │  build.mjs
      ├── Flags.swift  ─────────────►  iOS app: RemoteConfig.shared.value(for: Flags.x)
      ├── flags.ts     ─────────────►  web/admin: typed keys + defaults
      └── flags.md     ─────────────►  ops view

Backend (dreadnought, Postgres + GraphQL + Redis)
  • feature_flags table (key, type, enabled, default, rollout_pct, targeting) — seeded from FLAG_DEFS
  • query featureFlags(context): resolves each flag for the requesting user
      enabled? → targeting match? → stable %-rollout (hash(userId+key) < pct) → value/variant
  • Redis-cached; admin mutations to toggle / set rollout
      │
      ▼
Clients fetch the resolved map on launch (+ refresh), cache locally, and
fall back to the SSOT `default` when offline or for unknown keys.

Admin console gets a flags screen (list, toggle, rollout %). iOS is the priority consumer (App-Store cadence → server-driven gating). See ~/Desktop/development/SSOT_REFACTOR.md for cross-repo status.

Consume

  • iOS: add the SwiftPM package, import MoshFlags, then RemoteConfig.shared.value(for: Flags.maintenanceMode) (the app provides RemoteConfig, conforming to FlagResolving).
  • web/admin: npm i @moshevents/flags, import { Flags, FLAG_DEFS } from "@moshevents/flags".