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

@owlmeans/code-structure

v0.1.18-rc.0

Published

Checker and codemods for the OwlMeans code-structure rules: types, consts and code live in separate files

Readme

@owlmeans/code-structure

Checker and codemods for the OwlMeans code-structure rules:

  • types and interfaces live in types.ts (types.local.ts for the package-private ones);
  • constants and enums live in consts.ts (consts.local.ts);
  • code lives in every other file and declares no type, enum or constant of its own;
  • helpers are factory-built objects, entity logic is a model over a plain record.

The rules and the reasons are in the owlmeans-code-structure skill (shipped with this package).

Install

bun add -d @owlmeans/code-structure@^0.1.18-rc.0

Add a root script and, for Claude Code, the hook:

{ "scripts": { "check:structure": "owlmeans-structure check" } }
{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write|MultiEdit",
  "hooks": [ { "type": "command", "command": "owlmeans-structure hook" } ] } ] } }

Configure

.owlmeans-structure.json at the repo root (all keys optional):

{
  "include": ["packages/*/src/**/*.{ts,tsx}"],
  "exclude": [],
  "relaxed": ["packages/library/src/skills/**"],
  "baseline": ".owlmeans-structure.baseline.json",
  "standaloneLimit": 3
}

relaxed paths may keep package-private types and constants beside their code and are not held to the standalone-function limit. Tests, build/, dist/, agent-meta/, fixtures/ and *.d.ts are always excluded.

Commands

| Command | Does | |---|---| | owlmeans-structure check [files…] [--strict] [--json] | reports violations; with a baseline file only those beyond it | | owlmeans-structure check --update-baseline | records today's violations as tolerated | | owlmeans-structure hook | PostToolUse hook: reads the event on stdin, reports the edited file | | owlmeans-structure split --slot <dir> --repos a,b [--apply] | moves types and constants out of code files, rewriting every importer | | owlmeans-structure convert --slot <dir> --repos a,b [--apply] | groups the standalone functions of non-public modules into factory-built helpers | | owlmeans-structure api --snapshot f.json / --diff f.json | public surface of every package before/after a change |

Rules reported: exported-type-in-code, exported-const-in-code, local-type-in-code, local-const-in-code, code-in-types, code-in-consts, type-in-consts, const-in-types, standalone-functions. A declaration is exempted with // owlmeans-structure: allow <reason> on the line above it, a file with /* owlmeans-structure: allow-file <reason> */.

How it reads code

The parser is the TypeScript syntax tree shipped inside ts-morph, so it works under TypeScript 7 (which has no JavaScript API) and needs no program or type information. See the skill's reference.md for what counts as a constant, as state and as code.