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

@moku-labs/common

v0.3.0

Published

Shared framework plugins for the Moku family, built on @moku-labs/core.

Readme

@moku-labs/common

Shared, framework-agnostic plugins for the Moku family.

Author a plugin once, reuse it across every Moku framework. @moku-labs/common is a catalog — it exports plugin objects built on the @moku-labs/core micro-kernel, ready to drop into any framework's createCoreConfig. No framework of its own, no lock-in.

npm types browser entry node license: MIT

Install · Catalog · Usage · Entry points · Scripts


Install

bun add @moku-labs/common @moku-labs/core

[!NOTE] Status: 0.x — early. The catalog is small and growing. The plugins are built on @moku-labs/core; install it alongside (your framework already depends on it).

Why @moku-labs/common

  • Write once, reuse everywhere. Cross-cutting plugins (logging, env, …) live here instead of being copy-pasted into every Moku framework.
  • A catalog, not a framework. No createApp, no defaults of its own. You import plugin objects and register them in your framework's createCoreConfig.
  • Core plugins. Everything here is built with createCorePlugin, so a plugin's API is injected onto every plugin's context (ctx.log, ctx.env) — framework-agnostic by construction.
  • The /browser entry is guaranteed node-free. A client-safe subset whose static import graph references zero node modules, enforced by a CI gate.

Catalog

| Export | Kind | Responsibility | |---|---|---| | logPlugin | core plugin | Always-on in-memory trace + an expect() event-trace DSL for testable workflows. Injected as ctx.log. | | envPlugin | core plugin | Multi-provider environment / secret injection, validated and frozen at onInit, with PUBLIC_ cross-validation. Exposed as ctx.env. | | dotenv · processEnv · cloudflareBindings | env providers (Node) | Resolve env from .env files / process.env / Cloudflare bindings. Import node:fs. | | browserEnv | env provider (browser) | Reads import.meta.env + globalThis.__ENV__. Zero node:*. | | createBrandConsole · createBrandPrompts · brandedSink | CLI kit (Node) | The family's branded terminal renderer — console / prompts / log-sink + ANSI primitives. Imported from @moku-labs/common/cli. | | Log · Env | type namespaces | Log.LogApi, Env.EnvConfig, … |

Usage

Register the plugins in your framework's createCoreConfig — their APIs are then injected onto every plugin's context:

// my-framework/config.ts
import { createCoreConfig } from "@moku-labs/core";
import { envPlugin, logPlugin } from "@moku-labs/common";

type Config = { /* … */ };
type Events = { /* … */ };

export const coreConfig = createCoreConfig<Config, Events, [typeof logPlugin, typeof envPlugin]>(
  "my-framework",
  {
    config: { /* … */ },
    plugins: [logPlugin, envPlugin] // ctx.log + ctx.env on every plugin
  }
);

Supply the env provider that matches each target:

import { dotenv, processEnv } from "@moku-labs/common"; // Node
import { browserEnv } from "@moku-labs/common/browser"; // browser (node-free)

Entry points

| Entry | Format | For | Includes | |---|---|---|---| | @moku-labs/common | dual ESM + CJS | Node | the full catalog, incl. the Node env providers (dotenv / processEnv / cloudflareBindings) | | @moku-labs/common/cli | dual ESM + CJS | Node CLIs | the branded CLI kit — createBrandConsole, createBrandPrompts, brandedSink, and the ANSI primitives | | @moku-labs/common/browser | ESM-only | client bundles | logPlugin, envPlugin, browserEnv and the Log / Env types — with all node-only code excluded |

Importing @moku-labs/common/browser can never drag node:* code into a client bundle, regardless of bundler or tree-shaking — its static import graph references zero node-only modules. CI proves it:

bun run check:bundle   # asserts: zero static node imports + under the gzip budget

Scripts

bun run build              # build with tsdown (dual ESM+CJS + ESM-only browser entry)
bun run test               # all tests (vitest)
bun run test:unit          # unit tests only
bun run test:integration   # integration tests only
bun run test:coverage      # tests with coverage (90% threshold)
bun run lint               # biome check + eslint
bun run lint:fix           # auto-fix lint issues
bun run format             # format with biome
bun run validate           # publint + attw — verify the package export map
bun run check:bundle       # assert the browser bundle is node-free + under the gzip budget

Requirements

  • Node >= 24 and Bun >= 1.3.14 — use bun exclusively (never npm/yarn/pnpm).
  • TypeScript in strict mode, with exactOptionalPropertyTypes and noUncheckedIndexedAccess.
  • @moku-labs/core — the micro-kernel the plugins are built on.

License

MIT © moku-labs