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

@cosyte/vitest-config

v0.0.2

Published

Shared Vitest config (v8 coverage, per-directory >=90 gates) for @cosyte/* packages.

Readme

@cosyte/vitest-config

Shared Vitest config for the @cosyte/* packages: v8 coverage with text / html / lcov reporters, the standard excludes (barrels, fixtures, generated code, declarations), and enabled, gating per-directory thresholds at >= 90.

Install

pnpm add -D @cosyte/vitest-config vitest @vitest/coverage-v8 vite

vitest, @vitest/coverage-v8, and vite are peer dependencies (Vitest 4 needs vite >= 6 — install it explicitly so the resolver doesn't keep an incompatible vite 5).

Use

vitest.config.ts:

import { cosyteVitest } from "@cosyte/vitest-config";

export default cosyteVitest({
  coverageDirs: ["parser", "model", "serialize", "helpers"],
});

Each entry in coverageDirs adds a per-directory src/<dir>/** gate at >= 90 on top of the global gate. Use coverageThresholds to add or override specific keys, and test for any other Vitest options.

Doc/code agreement — @cosyte/vitest-config/snippets

The /snippets subpath is the documentation analog of the conformance runners: it proves the examples in a package's docs-content/ still do what the prose claims. A copy-pasteable snippet that silently returns the wrong field — a dose, a code, an identifier — is a clinical-harm failure mode wearing a documentation costume, so a green docs build carrying a wrong snippet is exactly what this prevents.

Mark a fenced block opt-in with ```ts runnable and assert its output inline with // =>:

```ts runnable
import { parseHl7 } from "@cosyte/hl7";

const { warnings } = parseHl7(raw);
warnings.length; // => 0
```

docSnippetSuite() walks a docs directory, turns each runnable block into a Vitest test labelled by file and line, compiles it, and executes it — a line of the form <expr>; // => <value> becomes expect(<expr>).toStrictEqual(<value>). A block tagged ```ts runnable throws must throw instead.

// test/docs-content.test.ts
import { join } from "node:path";
import { docSnippetSuite } from "@cosyte/vitest-config/snippets";

docSnippetSuite({
  docsDir: join(import.meta.dirname, "..", "docs-content"),
  // Point a snippet's `import ... from "@cosyte/hl7"` at what you want to prove against — this repo's
  // source for a fast local gate, or `../dist/index.js` (after `pnpm build`) for artifact fidelity.
  resolve: (spec) =>
    spec === "@cosyte/hl7" ? join(import.meta.dirname, "..", "src", "index.ts") : undefined,
});

Options: docsDir / files, include (default .md / .mdx), resolve (import-specifier remapper), runnableTag (default "runnable"), name, requireSnippet, tmpDir. A package with no runnable snippets yields an empty, passing suite — absence degrades quietly; a wrong snippet fails loudly. The primitives (extractRunnableSnippets, rewriteAssertions, remapImports, runSnippet) are exported too, for bespoke wiring.

runSnippet writes a transient .ts module under tmpDir (default .cosyte-doc-snippets/ in the project root) and imports it so Vitest transforms the TypeScript — add .cosyte-doc-snippets*/ to .gitignore. It must stay inside the project root; files under node_modules are not transformed.

Part of cosyte/config — one enforced toolchain for the @cosyte/* suite.