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

@evrdk/utils

v0.0.13

Published

Shared browser and server utilities for EVR projects.

Downloads

2,014

Readme

@evrdk/utils

Shared ESM utilities for schema-validated functions, with runtime-neutral, browser, and server entry points.

Installation

bun add @evrdk/utils

Install a Standard Schema library such as Zod, Valibot, or ArkType to define schemas. The TypeBox adapter needs the optional @sinclair/typebox peer.

Features

  • Typed input and output validation through Standard Schema V1.
  • Synchronous or asynchronous handlers and validators, always returning a promise.
  • Schema transformations, defaults, and structured validation errors.
  • Lazy TypeBox/Elysia adapter with separate runtime entry points.

Usage

With Zod installed (bun add zod):

import { createValidatedFn } from "@evrdk/utils";
import { z } from "zod";

const double = createValidatedFn({
  input: z.object({ x: z.number() }),
  output: z.object({ result: z.number() }),
  handler: ({ x }) => ({ result: x * 2 })
});

const result = await double({ x: 5 }); // { result: 10 }

For TypeBox, install bun add @sinclair/typebox and adapt schemas before passing them to createValidatedFn:

import { typeboxSchema } from "@evrdk/utils/typebox";
import { Type } from "@sinclair/typebox";

const input = typeboxSchema(Type.Object({ x: Type.Number() }));

The adapter also accepts Elysia's t schemas. Import elysia when using its custom types or formats to initialize its registry.

API and configuration

| API or entry point | Purpose | | ----------------------------------------------- | ------------------------------------------------------------------------------------ | | createValidatedFn({ input, output, handler }) | Validate input, run the handler, then validate output; returns an async function. | | SchemaValidationError | Validation failure with phase ("input" or "output") and structured issues. | | typeboxSchema(schema) | Adapt TypeBox schemas to Standard Schema; also exported from @evrdk/utils/typebox. | | @evrdk/utils | Runtime-neutral exports of the three APIs above. | | @evrdk/utils/browser, /server | Same validation APIs plus browserLog or serverLog. |

The handler receives the input schema's transformed output and returns the output schema's input. Callers receive the validated, transformed output. Handler and validator exceptions propagate unchanged.

TypeBox defaults apply to a clone, leaving caller data unchanged. Coercion must be defined by a schema transformation; there is no blanket conversion. Each adapter compiles its validator once on first validation.

Development

See AGENTS.md for runtime boundaries, adapter invariants, and type/behavior tests.