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

@compforge/spec-case

v0.0.4

Published

TypeScript spec/case assets, markers, and the specgen static extractor.

Readme

spec-case (TypeScript)

TypeScript 的 canonical CaseSet runtime,以及 spec / case / link / rule markers 与静态 specgen。CaseSet runtime 供 e2e / eval / perf 等 Harness 读取同一份资产;specgen 把绑定到代码 symbol 的 decorator 或 JSDoc marker 编译成 spec.json

安装

npm install @compforge/spec-case

读取并校验可同时交给 Eval 与 Perf 的 CaseSet:

import { loadCaseSet, validateCaseSet } from "@compforge/spec-case/model";

const cases = loadCaseSet("cases/ordinary-chat.yaml");
validateCaseSet(cases);

class 和 method 可以使用 no-op decorators:

import { Case, Link, Rule, Spec } from "@compforge/spec-case";

class Service {
  @Spec("returns the notebook when it exists")
  @Case("found", "existing id", { expect: "notebook returned" })
  @Link("docs/notebook.md")
  @Rule("keep tenant filtering in the query")
  get(): void {}
}

TypeScript overload 需要分别维护契约时,给 spec 配置同一 symbol 内唯一的 id

/** @spec id=string_input,text=`looks up string input` */
export function get(value: string): string;
/** @spec id=number_input,text=`looks up numeric input` */
export function get(value: number): number;
export function get(value: string | number): string | number;

decorator 对应写法为 @Spec("looks up string input", { id: "string_input" })。所有 entry 都输出 specs[];只有一个 spec 时 id 可省略,同一 symbol 的多个 spec 必须全部配置唯一 id。

普通 function、function-valued variable 和纯类型 symbol 使用 JSDoc marker,无需运行时 import。完整语法 与 symbol-id 规则见 spec/languages/typescript.md

生成与检查

npx specgen <src-dir> -o spec.json --root <repo-root>
npx specgen <src-dir> -o spec.json --root <repo-root> --check

specgen 使用 TypeScript Compiler API 静态解析源码,不 import 或执行被扫描项目。