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

@imanect/yui

v0.5.0

Published

Yui(結): Markdown の ```ui ブロックに図を書くための、LLM が書きやすい小さな記法。パーサ・SVG レンダラー・React 部品

Readme

@imanect/yui

Yui (結) — a tiny, LLM-friendly notation for drawing figures inside Markdown, with a parser, an SVG renderer and React components.

Models write a few lines of data in a ```ui block; the renderer decides layout, colors and axes. It is designed to be written correctly by small models with a short prompt, rendered while streaming, and safe for any input (no HTML, URLs or scripts).

```ui
bar Monthly sales [1]
unit: 10k JPY
Month | Sales | Profit
Jan | 120 | 30
Feb | 150 | -10
```

Five figure kinds: bar, line, stat (KPI cards), flow (flowcharts with branches and loops) and stack (layered architecture diagrams). The parser is lenient with what models naturally write (GFM tables, Mermaid-style arrows, Japanese number formats such as 1億2,000万円 or △120) and reports per-line diagnostics instead of failing the whole block.

Install

npm install @imanect/yui

react (>= 18) is an optional peer dependency, needed only for @imanect/yui/react.

React

import { YuiBlock, isYuiLanguage } from "@imanect/yui/react";

// e.g. with react-markdown
<Markdown
  components={{
    code({ className, children }) {
      return isYuiLanguage(className)
        ? <YuiBlock source={String(children)} streaming={isStreaming} />
        : <code className={className}>{children}</code>;
    },
  }}
>
  {text}
</Markdown>

YuiBlock re-lays out to its container width, follows the page's light/dark theme, and while streaming draws only completed lines — a figure grows and never shows a half-written value.

Charts are interactive on screen: hovering (or tapping) a category shows every series' value in a tooltip and dims the other categories; line charts add a guide line. Flowcharts highlight the hovered box with its edges and neighbors. The figure is one tab stop — arrow keys step through the values, Escape hides them, and a live region reads them out. Pass interactive={false} to turn this off. Exported SVG is never interactive.

SVG (browser or server)

import { parseBlock } from "@imanect/yui";
import { renderSVG } from "@imanect/yui/svg";

const { figure } = parseBlock(source, { final: true });
renderSVG(figure!);                                  // for screens: CSS variables, fluid width
renderSVG(figure!, { theme: "light", width: 720 });  // for export: colors and size baked in

The same layout drives both outputs, so what you export is what you saw. Every SVG carries a <desc> with a plain-text table of the data for screen readers.

Theming

Colors are CSS custom properties: --yui-s1 … --yui-s8 (series), --yui-ink, --yui-ink2, --yui-muted, --yui-grid, --yui-axis, --yui-surface, --yui-surface2, --yui-border, --yui-accentWash, --yui-accentLine. Set them on any ancestor to match your design system; --yui-font sets the typeface. The defaults are muted, seasonal hues on cool neutrals, validated for color-vision deficiencies with separate light and dark steps.

In auto mode Yui follows the page first — <html class="dark"> (Tailwind, next-themes) or <html data-theme="dark">, and light likewise — and falls back to prefers-color-scheme.

Parser only

import { parseMarkdown, toText } from "@imanect/yui";

for (const seg of parseMarkdown(streamingText)) {
  if (seg.type === "ui" && seg.result.figure) draw(seg.result.figure);
}
toText(figure); // plain-Markdown fallback (tables / lists)

Docs

License

Licensed under either of MIT or Apache-2.0 at your option.