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

relational-text

v0.1.1

Published

Rich text facets for the atproto ecosystem — text + typed annotations with CRDT-safe semantics

Readme

relational-text

Rich text as a relation. A document is a UTF-8 string and a flat table of typed annotations over byte ranges — nothing more. Every format is a view. Conversions are morphisms derived by panproto. The core is Rust compiled to WASM; this package is the TypeScript SDK with support for 38 rich text formats and the Layers annotation model.

Installation

pnpm add relational-text

Note: ESM-only. Requires Node.js 18+ or a WASM-capable bundler (Vite, webpack 5, Next.js 13+).

Quick start

import { from, to } from 'relational-text/registry'

const doc = await from('markdown', '# Hello\n\nThis is **bold** text.')
const html = await to('html', doc)
// → <h1>Hello</h1><p>This is <strong>bold</strong> text.</p>

Sub-path exports

import { Document } from 'relational-text/core'
import { applyLens, LensGraph } from 'relational-text/lens'
import { from, to } from 'relational-text/registry'
import { LayeredDocument } from 'relational-text/layered-document'
import { KnowledgeResolver, createDefaultResolver } from 'relational-text/knowledge'
import { computeAnnotationRanges } from 'relational-text/annotation-overlay'
import { ConceptIndex } from 'relational-text/concept-index'
import { toLayers, fromLayers, convertViaPanproto } from 'relational-text/layers'

Layers annotations

Semantic annotations use the Layers model (pub.layers.annotation):

import { LayeredDocument } from 'relational-text/layered-document'

const layered = LayeredDocument.fromDocument(doc)
const annotated = layered.addLayer({
  expression: 'doc',
  kind: 'span',
  subkind: 'entity-mention',
  annotations: [{
    uuid: { value: crypto.randomUUID() },
    anchor: { textSpan: { byteStart: 0, byteEnd: 5 } },
    label: 'ingredient',
    knowledgeRefs: [{ source: 'wikidata', identifier: 'Q14806', label: 'flour' }],
  }],
  createdAt: new Date().toISOString(),
})

// Query annotations
const atPos = annotated.annotationsAt(3)
const inRange = annotated.annotationsInRange(0, 10)
const byKind = annotated.query({ kind: 'span', subkind: 'entity-mention' })

Cross-format conversion

Any two formats with a lens path convert automatically. The panproto protolens pipeline handles structural alignment; value-dependent rules (matchAttrs, template names) are applied post-restrict.

const doc = await from('tiptap', tiptapJson)
const slack = await to('slack', doc)
const bbcode = await to('bbcode', doc)

Supported formats

| Category | Formats | |----------|---------| | Markup | CommonMark, GFM, HTML | | JSON editors | Quill Delta, ProseMirror, TipTap, Lexical, Slate, Contentful, Sanity, Notion | | Social | Bluesky, Mastodon, Slack, Discord, Telegram, WhatsApp, LinkedIn, Threads | | Documents | BBCode, Org-mode, OPML, Apple News | | Notebooks | Jupyter, Obsidian, Roam, Logseq | | Markdown variants | MultiMarkdown, Pandoc, GitLab, MDX, MyST, Markdoc | | Wiki / CMS | Confluence, JIRA, DokuWiki, MediaWiki, Textile | | Specialized | Fountain |

License

MIT OR Apache-2.0

Copyright 2026 Blaine Cook