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

@concordance-wiki/typing

v1.0.0

Published

Type cascade, identifiers, application and domain resolution.

Readme


Why

Concordance builds a wiki from your repositories with zero configuration, and gets richer when you tell it that everything under screens/ is a screen and every .rule.md is a rule. You install @concordance-wiki/concordance for that. This package is the part of it that applies those rules: the type cascade that gives every markdown file its type, the entity built from a parsed note, and the application and domain each entity is filed under. The build and the linter both call it, so a type is decided the same way on your machine and in the published wiki. Install it alone to build on the engine.

Quick start

npm install @concordance-wiki/typing

The type of one file, from the rules of its source and its frontmatter, the way concordance build and concordance lint decide it:

import { loadDefaultProfile } from "@concordance-wiki/profile";
import { resolveType } from "@concordance-wiki/typing";

const source = { name: "specs", rules: [{ match: { suffix: ".rule.md" }, set: { type: "rule" } }] };
const resolved = resolveType({ source, path: "checks/link-broken.rule.md", frontmatter: {}, profile: loadDefaultProfile() });
resolved.type; // "rule"
resolved.origin; // "suffix": the kind of rule that matched, "frontmatter" when the note says its type

What you get

  • One cascade, four levels: resolveType applies the source's default_type, its type, the typing rules in order and the frontmatter type, in increasing precedence, and says which one decided.
  • Conflicts named: E-TYPE-CONFLICT when a note contradicts its suffix rule, W-TYPE-UNKNOWN when the profile does not know the type.
  • A note becomes an entity: buildEntity and buildResourceEntity give each file its identifier, title, aliases, status, summary, attributes and location.
  • Filed where it belongs: compileDomains, resolveDomain, resolveApplication and the W-APP-* and W-DOMAIN-* findings when a note is filed nowhere or somewhere undeclared.
  • The whole corpus at once: typeSources runs all of the above over every parsed file, resolves duplicate identifiers (E-ID-DUP) and returns entities and findings in canonical order.

Documentation

Part of Concordance, MIT licence.

resolveType runs the type cascade of one markdown file, in increasing precedence the source's default_type, the source's type, the typing rules in order (path glob, suffix, ext, frontmatter criteria, every criterion of a rule required, the last match wins) and the frontmatter type; it records the origin (source, rule#3, suffix, frontmatter), the attribute defaults set by the matching rules, E-TYPE-CONFLICT when the frontmatter contradicts a suffix rule (the frontmatter is kept) and W-TYPE-UNKNOWN when the profile does not declare the type (the note becomes a document). buildEntity turns one ingested and parsed file into an Entity: deterministic identifier, title (frontmatter, H1, file name), aliases, status, summary (frontmatter, first paragraph), the frontmatter attributes over the rule defaults with W-ATTRIBUTE-UNKNOWN for the keys the type and the common attributes do not declare, the source location, the type origin and graph (documents-only for the types the profile marks so, document and meeting by default); buildResourceEntity does the same for a file a reader or a converter knows. compileDomains flattens the domains tree of the configuration into id paths (inference/recognition) with one glob matcher each, and resolveDomain files one path under the frontmatter domain (by id or id path; an unknown value is kept as written and marked undeclared), else under the deepest domain whose globs match the source-relative path (the last declared wins at equal depth), else under unclassified. resolveApplication takes the frontmatter application, else a rule's set.application, else the source's application, and says whether applications: declares it. buildEntity records both on the entity and filingFindings reports W-APP-MISSING, W-APP-UNKNOWN, W-DOMAIN-UNCLASSIFIED and W-DOMAIN-UNKNOWN, the first and the third never for the container types (applications and domains as notes). typeSources does it for every parsed markdown file and every known resource of the ingested sources, resolves duplicate identifiers (E-ID-DUP) and returns entities and findings in canonical order.