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

flatmatter

v2.0.2

Published

A data serialization language, and library, with support for functions.

Downloads

15

Readme

FlatMatter

A YAML-like data serialization language with support for functions. FlatMatter is considered feature-complete and is intentionally kept simple. Bug fixes and performance improvements are still made, of course.

Example FlatMatter:

title: "My Blog"
last_updated: (get-content "posts") / (limit 1) / (get "published_at") / (date "YYYY-mm-dd")
posts: "posts" / get-content

FlatMatter aims to be more-or-less syntactically compatible with YAML for the simple reason of not needing new editor plugins to have syntax highlighting, but it differs in that there is no indentation, but instead dots to indicate hierarchy, like site.title which would result in a site object that contains the title key.

FlatMatter also supports functions, allowing you to build your own data DSL, and functions can also be piped with the forward slash / character, meaning that the result of the left operation will be passed as the first argument of the next function, and so on, to produce an end result.

Additionally, FlatMatter also parses FrontMatter content, meaning that a FlatMatter file like this:

---
title: "Hello, World!"
---
Content goes here.

Would result in this data being created:

{
  "title": "Hello, World!",
  "content": "Content goes here."
}

Install

npm i flatmatter

Usage

The most basic usage looks like this:

import FlatMatter from "flatmatter";

const config = FlatMatter.config('key: "value"');

// {key: "value"}

However, you most likely want to use it with functions. Those you have to create yourself.

const toUpper = {
  name: 'to-upper',
  compute: (input: string): unknown => {
    return input.toUpperCase();
  }
}

A FlatMatter function has to have a name property and a compute callable which takes a string and returns something. And, like I mentioned before, a thing to keep in mind is that if the function is piped, the first argument passed to it will be the result of the previous operation.

Once you have your functions, simply pass them to FlatMatter like this:

import FlatMatter from "flatmatter";

const config = FlatMatter.config('key: "value" / to-upper', [toUpper]);

// {key: "VALUE"}