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

@skiesjs/core

v0.1.0

Published

HTTP-agnostic result and error primitives for Skies Node.js slices.

Downloads

0

Readme

@skiesjs/core

HTTP-agnostic primitives shared by Skies Node.js slices and adapters. The package is plain TypeScript and has no Express dependency.

Results and errors

Result<T> is a discriminated union. Expected failures carry the closed ErrorKind catalog and stable client-facing codes:

import { Errors, Result, type Result as Outcome } from "@skiesjs/core";

function findWallet(id: string): Outcome<{ id: string }> {
  return id === "known"
    ? Result.ok({ id })
    : Result.fail(Errors.notFound("wallets.not_found", "wallet not found"));
}

Accumulated validation

Validation records all field failures before a slice returns. collect preserves nested field paths and codes from another failed Result; require accepts a syntactically valid non-nil UUID; inRange includes both bounds.

const validation = new Validation()
  .require(input.walletId, "walletId", "walletId.required")
  .notBlank(input.name, "name", "name.required")
  .inRange(input.amount, 1, 10_000, "amount", "amount.out_of_range")
  .collect("money", Money.from(input.amount));

if (validation.failed) return Result.fail(validation.toError());

Pages

Page<T> is the structural four-member wire shape. mapPage projects items while copying totalCount, pageNumber, and pageSize unchanged, including for empty pages past the end.

const views = mapPage(walletPage, (wallet) => ({ id: wallet.id, name: wallet.name }));

Ordered lifecycles

Declare state order explicitly. A future step is not reached, and advance changes the cursor only when the step being completed is exactly the current one, so revisiting an earlier step cannot regress it.

const onboarding = orderedLifecycle(["profile", "identity", "review", "done"] as const);
if (!onboarding.reached(current, "identity")) return Result.fail(notReached);
current = onboarding.advance(current, "identity", "review");

Scalar codecs

A ScalarCodec<TValue, TPrimitive> keeps a value object's smart constructor authoritative on inbound data while encoding the object as the primitive it replaced. Runtime primitive metadata lets contract adapters keep the same wire schema. Use trustedScalarCodec only for values already trusted by the caller.

const centsCodec = scalarCodec<Cents, number>({
  primitive: { type: "integer", format: "int64" },
  encode: (cents) => cents.value,
  decode: Cents.from,
});