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

@intentset/help

v0.18.0

Published

Reads the help file intentset publish writes and binds its tips to the controls of a product's interface. No dependencies, runs in a browser.

Readme

@intentset/help

Reads the help.json that intentset publish writes and puts each tip on the control of a product's interface that delivers the behavior it explains. No dependencies; it runs in a browser and refuses a file with any problem, whole.

Install

npm install @intentset/help
pnpm add @intentset/help

Example

import { bindTips, readHelp } from "@intentset/help";

const read = readHelp(await (await fetch("/help/help.json")).text());
if (read.ok) {
  const { bound, missing, pendingReview } = bindTips(document, read.help); // every element with data-behavior="BEH-..." gets its tip
  console.log(`${bound.length} tips bound; no tip yet for`, missing, "; help under review for", pendingReview);
}

By default a bound control gets data-help-tip (the tip's text) and data-help-knowledge (the knowledge ID it came from) and nothing a browser displays. A title shows only on mouse hover, never to keyboard or touch users, so the product shows the tip, as a visible tooltip and an accessible description, through render:

bindTips(document, read.help, {
  render: (element, tip) => myTooltip.attach(element, tip.text), // your tooltip component, reachable by keyboard and touch
});

bindTips binds once. watchTips binds, then binds again whenever the DOM under its root changes, once per animation frame, and unrenders every element it bound when disposed, so help mounted into another application's page binds only under its own root and leaves that page as it found it. With the default render, dispose puts data-help-tip and data-help-knowledge back as they were; with your own render, pass the unrender that undoes it:

import { watchTips } from "@intentset/help";

const watch = watchTips(container, read.help, {
  render: (element, tip) => myTooltip.attach(element, tip.text),
  unrender: (element) => myTooltip.detach(element), // with your own render and no unrender, nothing is undone
});
watch.coverage(); // { bound, missing, pendingReview } as of the last pass
watch.dispose(); // stop observing and unrender every element it bound

Help under review. A publication may keep knowledge under review (publication §3, ADR 0027): published from the text its last review covered while what it explains has changed. Its entry in knowledge, and each tip it contributes, carries underReview: true; a tip keyed to a rule is held back instead and its ID listed in withheldForReview, because a rule's tip is the reason a product gives for a refusal. Every reader here leaves help under review out by default (underReviewHelp: "exclude"), since your renderer may not show that it is under review; pass underReviewHelp: "include" to tipFor, helpForPage, articles, bindTips or watchTips once it does, and show the mark wherever you show the item. Either way the ID goes to pendingReview, never to missing, and a bound element under review also gets data-help-under-review.

tipFor returns null for no tip, a held-back rule tip and, under exclude, a tip under review alike, so it cannot measure coverage on its own. Count coverage from a Binding (bound, missing, pendingReview), from helpForPage, or from reviewStateFor(help, id), which answers current, under-review, held-back or none; a coverage report counts held-back as written. articles(help, options) gives the file's articles honouring underReviewHelp, with the IDs under review in pendingReview:

import { articles, reviewStateFor, tipFor } from "@intentset/help";

tipFor(read.help, "BEH-ASMT-SCHEDULE", { underReviewHelp: "include" }); // the tip, with tip.underReview when it is
reviewStateFor(read.help, "RULE-ASMT-AUTH"); // "held-back" while its knowledge is under review
const { knowledge, pendingReview } = articles(read.help); // current articles; under-review IDs in pendingReview

Lead articles for a page

A slice may say which knowledge leads each surface of the product, a page, route, panel or module named by an ID the product chooses (VSA §3, ADR 0028), and the help file maps each surface to the articles published for its reader. leadFor returns a surface's articles in order, and helpForPage with a surface lists them first, then the articles its controls' tips reach, each once:

import { helpForPage, leadFor, surfaceHelp } from "@intentset/help";

leadFor(read.help, "lantern-web:/assessments/schedule"); // the lead articles, in order, or []
const page = helpForPage(read.help, ["BEH-ASMT-SCHEDULE"], { surface: "lantern-web:/assessments/schedule" });
page.knowledge; // the lead first, then the tips' articles
page.leadPendingReview; // the leads under review, which are left out unless underReviewHelp is "include"
surfaceHelp(read.help, "lantern-web:/assessments/schedule"); // { lead, pendingReview }

leadFor returns [] both for a surface the file does not list and for one whose leads are all under review, so a coverage report uses surfaceHelp or helpForPage, never leadFor alone. A surface ID is the product's own text: insert it into markup or a selector only escaped.

Serving the file

The file was published for one reader: every audience, role and flag it names, on one product, release and edition. Those lists are held all-of, never read as "any of", so serve the file only where servedTo holds for the person:

import { type Reader, servedTo } from "@intentset/help";

const reader: Reader = {
  visibilities: ["public", "customer"],
  audiences: ["teacher"],
  roles: ["administrator", "teacher"],
  product: "PRD-LANTERN",
  release: "pilot-1",
  edition: "standard",
  flags: [],
};
if (read.ok && servedTo(read.help, reader)) bindTips(document, read.help);

The same test applies to a published document's intentset-publication block, which names the same entitlement. A reader refuses a file holding any member publication §5 does not give it, so a newer file is refused rather than shown in part.

Learn more

Part of Intentset, which keeps product intent connected to the code that delivers it and the checks that verify it, as readable Markdown files in a repository. The specifications are at https://intentset.org/specifications/ and the source at https://github.com/intentset/intentset.

Licence

MIT