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/copy

v0.8.11

Published

Mosh — single source of truth for user-facing copy. Typed `copy` for web/admin; iOS consumes the SwiftPM target.

Readme

mosh-copy

Single source of truth for user-facing copy across web, admin, and iOS. Edit strings in one place (copy.json), regenerate, and every platform consumes the same text — no more the-same-string-hardcoded-three-times-and-drifting. Same shape as mosh-tokens.

copy.json            ← the ONLY file you hand-edit (nested by area; leaves are strings or {$value,$comment})
build.mjs            ← dependency-free generator (plain node)
dist/                → npm package @moshevents/copy (compiled to lib/*.js + *.d.ts at publish)
  copy.ts            → web + admin: typed `copy` object (static strings + {param} → typed functions)
  copy.md            → human / designer / translator view
Sources/MoshCopy/    → SwiftPM package MoshCopy (iOS)
  Copy.swift         → nested type-safe `Copy` enums (static lets + funcs)
Package.swift        ← SwiftPM manifest

Usage

npm run build      # regenerate dist/ from copy.json
npm run check      # build + fail if dist/ is stale (use in CI)

No install required (Node ≥ 18). Commit dist/ so outputs are reviewable in diffs.

Authoring

{
  "events": {
    "empty": { "title": "No upcoming events" },          // plain string
    "attendeeCount": {                                    // with metadata + interpolation
      "$value": "{name} invited you",                     // {param} → a typed function
      "$comment": "context for translators / the showcase"
    },
    "attendeeCount": {                                    // plural → typed function, selects by count
      "$plural": { "zero": "Nobody going", "one": "{count} person going", "other": "{count} going" }
    }
  }
}

Plural categories: optional zero, one, required other. Selection is English CLDR (0→zero, 1→one, else other); the API is count-keyed and emits (count: Int) on iOS / { count: number } on web. Full per-locale plural rules arrive with localization.

Consuming as a package (the supported path)

Web / admin — @moshevents/copy (public on npmjs). No .npmrc, no token — npm i @moshevents/copy and import:

import { copy } from "@moshevents/copy";
copy.events.empty.title;                 // "No upcoming events"
copy.events.attendeeCount({ count: 3 }); // "3 going"

npm update @moshevents/copy pulls new copy — no vendored src/copy.ts to sync.

iOS — SwiftPM MoshCopy. Xcode → Add Package Dependencies → https://github.com/moshorg/mosh-copy, pin a version, then:

import MoshCopy
Copy.Events.Empty.title
Copy.Invite.greeting(name: "Sam")   // type-safe; a wrong key won't compile

SwiftPM resolves straight from the git tag — no registry/publish needed.

Releasing

Publishing is Trusted Publishing (OIDC) — no token or secret. One-time setup:

  1. Create the moshevents org on npmjs (claims the @moshevents scope).
  2. First publish manually (Trusted Publishing is configured on an existing package): npm login && npm publish from this repo (runs build.mjs + tsc).
  3. On npmjs → the package → Settings → Trusted Publisher → add GitHub Actions: repo moshorg/mosh-copy, workflow publish.yml.

After that, bump version and cut a GitHub Release (or run the Publish workflow) — it publishes to npmjs via OIDC, with provenance, no secret. The same tag is what iOS pins to.

Human-facing view

dist/copy.md renders every string for review. Same as mosh-tokens, this bundle can be synced to a claude.ai design/content project via /design-sync so a writer or designer can browse and propose copy without checking out code.

Migration (incremental, low-risk)

The repo ships seeded with a few genuinely-shared strings. Migrate the rest gradually: replace a hardcoded string with a copy.* reference, area by area. Once a screen is migrated, add a lint nudging new literals through keys (mirrors the tokens guard). No big-bang rewrite.

Deferred — out of scope for now

  • Localization — when you actually translate, emit Apple .xcstrings (String Catalog) + per-locale web bundles instead of single-locale literals. The key structure is already i18n-ready.
  • Typed numeric params{count} currently types as String on iOS / string | number on web; a $params hint could generate Int/typed args.
  • Server-driven copy — for high-churn / marketing strings that must change without an iOS release, serve them from the API; keep static UI chrome in this build.