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

@meow-meow-dev/server-utilities

v4.3.0

Published

A collection of matchers to easily test `Response` using [Vitest](https://https://vitest.dev/).

Readme

Vitest matchers

A collection of matchers to easily test Response using Vitest.

| Matcher | Expected status | Expected text | | ---------------------- | --------------- | ------------- | | toBeHTTPOk | 200 | Ok | | toBeHTTPBadRequest | 400 | Bad Request | | toBeHTTPUnauthorized | 401 | Unauthorized | | toBeHTTPForbidden | 403 | Forbidden | | toBeHTTPNotFound | 404 | Ok | | toBeHTTPConflict | 409 | Conflict |

When not given any argument, they expect the standard text response ("OK" for status 200, "Bad Request" for 404...). They can also expect a specific text (toBeHTTPOk("Update successful")) or json value (toBeHTTPOk({ json: { id: 2, name: "New item" } }))

Validation

#validation contains Valibot utilities.

vValibot

Drop-in replacement from @hono/valibot-validator's vValidator. Returns a text response "Bad Request" instead of a JSON containing the errors.

Schemas

| Schema | Validates | | ---------------------- | -------------------------------------------- | | queryIntegerIdSchema | integer identifiers inside query parameters. | | nonEmptyStringSchema | non-empty strings | | integerSchema | integer numbers |

Sample code

import {
  integerSchema,
  nonEmptyStringSchema,
  queryIntegerIdSchema,
  vValidator,
} from "#validation";
import { Hono } from "hono";
import { testClient } from "hono/testing";
import * as v from "valibot";
import { describe, it } from "vitest";

const route = new Hono().post(
  "/api",
  vValidator("query", v.strictObject({ id: queryIntegerIdSchema })),
  vValidator(
    "json",
    v.strictObject({ name: nonEmptyStringSchema, yearOfBirth: integerSchema }),
  ),
  (c) => {
    const { id } = c.req.valid("query");
    const { name, yearOfBirth } = c.req.valid("json");

    const age = new Date().getFullYear() - yearOfBirth;

    return c.text(
      `Hello ${name}, your id is #${id.toString()} and you're ${age.toString()} years old`,
      200,
    );
  },
);

const client = testClient(route);

describe("Matchers sample", () => {
  it("checks that name isn't empty", async ({ expect }) => {
    await expect(
      client.api.$post({
        json: { name: "", yearOfBirth: 1984 },
        query: { id: "23" },
      }),
    ).toBeHTTPBadRequest();

    await expect(
      client.api.$post({
        json: { name: "John Doe", yearOfBirth: 1984 },
        query: { id: "23" },
      }),
    ).toBeHTTPOk("Hello John Doe, your id is #23 and you're 41 years old");
  });
});