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

unhoax

v0.12.7

Published

type/data-centric schema library. A schema library empower you, not constrain you with their types messy types.

Readme

A Standard Schema-compliant library intended for data safety, leveraging concise & elegant types to prevent unreadable 100+ lines TypeScript error messages.

Following the unix mindset, unhoax proposes less features than other libraries, encouraging you to build your own custom schemas when relevant, ie: email schemas.


Installation

npm i -S unhoax

Getting Started

Check out the documentation website, you may want to start with the getting started guide 😊

Basic Usage

This section only describes trivial how tos, see the reference for a list of available schemas and utilities.

import { x } from 'unhoax'

interface User {
  id: number
  name: string
  email: string
}

const userSchema = x.typed<User>().object({
  id: x.number,
  name: x.string,
  email: x.string,
})
userSchema.parse({ … })
// { result: true, value: User } <- `User` is properly named via intellisense

// hovering on `userSchema` prompts this ; simple type, right?
const userSchema: x.ObjectSchema<
  User,
  SomeLongInternalsAfterYourEntityType
>

Inference

import { x } from 'unhoax'

const userSchema = x.object({
  id: x.number,
  name: x.string,
  email: x.string,
})
type User = x.TypeOf<typeof userSchema>

userSchema.parse({ … })
// { result: true, value: { id: number, … } } <- `User` is not properly named

const userSchema: x.ObjectSchema<{
    id: number;
    name: string;
    email: string;
}, SomeLongInternalsAfterYourEntityType>

Custom Types

import { x } from 'unhoax'

type Email = …
declare function isEmail(value: string): value is Email

const emailSchema = x.string.guardAs('Email', isEmail) // Schema<Email>

Safety first

There are default size guards everywhere, to diminish the risk of Denial of Service attacks, resource exhaustion and oversized payload.

import { x } from 'unhoax'

x.array.defaultMaxSize // 500
x.Set.defaultMaxSize // 500
x.Map.defaultMaxSize // 500
x.string.defaultMaxSize // 500

Those safety nts are not retro-active, you should define them at the entry-point of your program.

// You can define your own global guards:
x.array.defaultMaxSize = 3
// every array schema with no specific max size
// will now have a maximum of 3 items.

const mySchema = x.array(x.number)

mySchema.parse([1, 2, 3, 4]).success === false

You can deactivate those guards by providing the value Infinity:

x.array.defaultMaxSize = Infinity

Use unhoax with other tools

Leveraging the Standard Schema compliance:

Or any JSON Schema compatibility:

import { x, toJSONSchema } from 'unhoax'

const mySchema = x.object({ … }) // or x.array(…), or x.number, …
const schema = toJsonSchema(mySchema)

Generating random fixtures from your schemas

Visit unhoax-chance to see how to generate random fixtures from your schemas using ChanceJS.

The purpose of this library – Why yet-another?

See here