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

common-typescript-utils

v1.0.1

Published

Shared TypeScript utilities for the MiniAppPolis ecosystem.

Downloads

44

Readme

common-typescript-utils

Shared TypeScript utilities for the MiniAppPolis ecosystem. The TypeScript counterpart to common-python-utils.

Installation

npm install common-typescript-utils

Modules

createLogger(service)

Structured logger with dev/prod modes. In production emits JSON to stdout/stderr; in development emits emoji-prefixed human-readable lines.

import { createLogger } from "common-typescript-utils";

const logger = createLogger("my-service");

logger.info({ event: "server_started", category: "infra", context: { port: 3000 } });
logger.error({ event: "db_failure", category: "data", error: new Error("timeout") });
logger.start("initializing");   // 🚀 in dev, INFO JSON in prod
logger.success("ready");        // ✅ in dev, INFO JSON in prod
logger.failure("crashed");      // ❌ in dev, ERROR JSON in prod

Log categories: "infra" | "pipeline" | "data" | "api"

verifyClerkToken(token, jwksUrl)

Raw JWKS + RS256 JWT verification using the Web Crypto API. Runtime-agnostic — works in Node 18+, Cloudflare Workers, and Deno without any polyfills.

import { verifyClerkToken } from "common-typescript-utils";

const payload = await verifyClerkToken(token, "https://your-clerk-instance.clerk.accounts.dev/.well-known/jwks.json");
// payload.sub — owner_id
// payload.email — resolved from email or email_addresses

JWKS responses and imported keys are cached in-memory with a 1-hour TTL.

success / successList / error / CommonErrors

Standard API response envelopes.

import { success, successList, CommonErrors } from "common-typescript-utils";

return c.json(success({ id: 1, name: "foo" }));
// { data: { id: 1, name: "foo" }, meta: { version: "v1" } }

return c.json(successList(items), 200);
// { data: [...], meta: { version: "v1", count: 3 } }

return c.json(CommonErrors.notFound("User"), 404);
// { error: { code: "NOT_FOUND", message: "User not found" } }

Available helpers: unauthorized(), forbidden(), notFound(resource?), badRequest(message), internalError(message?), validationError(zodIssues).

Schemas

Generic Zod schemas for common API patterns.

import { PaginationSchema, IdParamSchema, UserRoleSchema } from "common-typescript-utils";

const { page, limit } = PaginationSchema.parse(req.query);
const { id } = IdParamSchema.parse(req.params);
const role = UserRoleSchema.parse(req.body.role); // "user" | "admin"

Note: Domain-specific schemas (WCS divisions, session/checkin status, etc.) live in the repos that own those domains.

Development

npm install
npm run typecheck
npm test
npm run build

Release

Releases are automated via semantic-release on push to main. Requires NPM_TOKEN and GITHUB_TOKEN secrets.

feat:     → minor bump
fix:      → patch bump
feat!:    → major bump