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

@sffmc/utilities

v0.16.0

Published

Shared SDK library for SFFMC plugins — loadConfig, mergeHooks, EventBus, FsOps, redactSecrets. Not a plugin entry; consumed via workspace:* by the other 4 packages.

Readme

@sffmc/utilities

Shared SDK library for the other SFFMC packages. Not a plugin — install only if you author user plugins that import its primitives.

This package provides the four primitives every SFFMC plugin needs:

  • loadConfig<T>(name, defaults) — type-safe YAML loader. Reads ~/.config/sffmc/<name>.yaml, merges with the provided defaults, validates against a JSON-schema if you pass one. Missing file → defaults (no exception). Type errors → typed Result<err>.
  • PluginContext — minimal interface every plugin server(ctx) receives. Carries projectRoot, config, and the typed event bus.
  • mergeHooks(plugins) — composes N plugin {id, server} results into one. Hook payloads are classified into transform (chainable), gate (veto-able), side-effect (fire-and-forget), or tool. Conflict resolution is per-class; the merger never crashes.
  • EventBus — typed pub/sub over plugin-internal events. Used by @sffmc/memory for cross-feature memory writes, by @sffmc/safety for cross-feature gate propagation, etc.

Plus smaller helpers you might need:

  • unixNow(), __setClock(), __resetClock() — deterministic time for tests
  • isSafeRunID(s), safeRunID(), RUN_ID_REGEX — validate wf_<24-char base36> run IDs
  • FsOps interface + defaultFsOps + createMockFsOps() — swap out real filesystem for testing
  • redactSecrets(s) — strip API keys / PEM blocks / ~/.env content from any string before logging
  • 15+ typed error classes (ConfigError, GitHubTokenMissingError, …) with stable names

Install (as library)

If you're authoring your own plugin and want loadConfig / mergeHooks / event typing:

npm install --save-peer @sffmc/utilities@^0.15.4

You do not add @sffmc/utilities to opencode.json plugins[]. It has no plugin entry — only TypeScript exports.

Why this is a library, not a plugin

The other four SFFMC packages depend on @sffmc/utilities for shared infrastructure. If it were a plugin entry, every npm install of any SFFMC plugin would also register it as a plugin — which would double-register and crash the id-uniqueness check in mergeHooks. By making it a library consumed via workspace:* (internally) or npm: peer-dependency (for users), it stays installable from npm without polluting plugins[].

Versioning

This package follows semver strictly. A breaking change in any export (renamed, removed, signature-shifted) is a major version bump. All other SFFMC packages depend on it via ^x.y.z in their own package.json.

License

MIT