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

@jxsuite/parser

v1.0.0

Published

Jx markdown parser and external class integration

Downloads

2,807

Readme

@jxsuite/parser

Markdown parser and external class integration for Jx.

Overview

@jxsuite/parser provides the content layer for Jx applications. It exports MarkdownFile and MarkdownCollection — external classes that satisfy the Jx $prototype + $src contract — and a transpile utility for converting Jx-flavored Markdown directly into Jx component objects.

Built on the unified / remark / rehype pipeline.

Installation

bun add @jxsuite/parser

MarkdownFile

Parses a single Markdown file into structured data.

{
  "state": {
    "post": {
      "$prototype": "MarkdownFile",
      "$src": "@jxsuite/parser/MarkdownFile.class.json",
      "src": "./content/posts/hello-world.md"
    }
  }
}

Resolved value:

| Property | Type | Description | | -------------- | -------- | ----------------------------------- | | slug | string | Filename without extension | | path | string | Full file path | | frontmatter | object | Parsed YAML frontmatter | | $body | string | Rendered HTML body | | $excerpt | string | First paragraph as HTML | | $toc | array | Table of contents (id, text, depth) | | $readingTime | number | Estimated reading time in minutes | | $wordCount | number | Word count |

MarkdownCollection

Globs Markdown files into a sorted, filterable collection.

{
  "state": {
    "posts": {
      "$prototype": "MarkdownCollection",
      "$src": "@jxsuite/parser/MarkdownCollection.class.json",
      "src": "./content/posts/*.md",
      "sortBy": "date",
      "sortOrder": "desc",
      "limit": 10
    }
  }
}

Returns an array of MarkdownFile resolved objects.

| Option | Type | Default | Description | | ----------- | -------- | -------- | ----------------------------------- | | src | string | — | Glob pattern for Markdown files | | sortBy | string | "date" | Frontmatter field to sort by | | sortOrder | string | "desc" | "asc" or "desc" | | limit | number | — | Maximum number of results | | filter | string | — | Frontmatter field filter expression |

MarkdownDirective (remark plugin)

Maps ::directive{attrs} syntax to custom element tags in HTML output. Parameters are encoded as a data-jx-props JSON attribute so Jx components can receive them via reactive state.

:::my-card{title="Hello" image="/img/hero.png"}
Card body content here.
:::

Produces:

<my-card data-jx-props='{"title":"Hello","image":"/img/hero.png"}'>
  <p>Card body content here.</p>
</my-card>

transpileJxMarkdown

Converts a Jx-flavored Markdown source string directly into a Jx component object (no file I/O).

import { transpileJxMarkdown } from "@jxsuite/parser/transpile";

const doc = transpileJxMarkdown(markdownString);
// { tagName: "article", children: [...] }

Parsing pipeline

  1. remark-parse — Markdown → MDAST
  2. remark-frontmatter + remark-parse-frontmatter — YAML extraction
  3. remark-gfm — GitHub Flavored Markdown
  4. remark-directive — directive syntax
  5. MarkdownDirective — directive nodes → custom element tags
  6. remark-rehype — MDAST → HAST
  7. rehype-stringify — HAST → HTML

License

MIT