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

@schlopai/tish-dark-matter

v1.0.1

Published

Modular gray-matter compatible frontmatter parser for Tish and JS (subset YAML/TOML, zero runtime deps)

Readme

@schlopai/tish-dark-matter

A modular, gray-matter compatible frontmatter parser for Tish and JavaScript.

Features

  • Extracts YAML, TOML, and JSON frontmatter from strings.
  • Gray-matter compatible API (matter(string, options)).
  • Supports MDX via language: 'mdx' or .mdx files by treating it the same as .md.
  • Exported as both a JS library and native .tish code.
  • No runtime npm dependencies: default YAML/TOML handling uses the same Tish implementation as native builds (src/engines.tish), compiled to dist/engines.js for the JS entry.

Supported syntax (default engines)

Default parsing is not full YAML 1.2 or full TOML. It matches typical flat gray-matter frontmatter:

  • YAML: one key: value per line; strings (quoted or plain), booleans, null/~, integers/decimals/scientific notation; # line comments and blank lines ignored.
  • TOML (+++ blocks): one key = value per line; basic strings (" with common escapes, ' literals with '' for a single quote), booleans, numbers; # comments and blank lines ignored.
  • JSON: standard JSON.parse / JSON.stringify.

Nested maps, anchors, multiline block scalars, and other advanced YAML/TOML features are not supported unless you supply your own engines override.

Tish-only consumers

Import the native module directly (see package.json export ./engines.tish):

import { parseYamlFrontmatter } from "@schlopai/tish-dark-matter/engines.tish"

Usage

import matter from "@schlopai/tish-dark-matter";

const { data, content } = matter(`---
title: Hello
---
World!`);

console.log(data.title); // "Hello"
console.log(content);    // "World!"

Adding custom engines

You can pass a custom engine parsing function via the engines option:

import matter from "@schlopai/tish-dark-matter";
import cbor from "cbor";

const result = matter(`---cbor
<cbor hex>
---
Body`, {
  engines: {
    cbor: (str) => cbor.decode(Buffer.from(str, "hex"))
  }
});