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

@danyiel-colin/tree-sitter-toon

v0.1.3

Published

Tree-sitter grammar for TOON (Token-Oriented Object Notation)

Readme

tree-sitter-toon

Tree-sitter grammar for TOON (Token-Oriented Object Notation).

Features

  • Full TOON spec compliance (v3.0)
  • External scanner for indentation-sensitive parsing
  • Support for all TOON constructs:
    • Objects with nested structures
    • Tabular arrays with field lists
    • List arrays with mixed content
    • All delimiter types (comma, tab, pipe)
    • Dotted keys (a.b.c: value)
    • Quoted keys and strings with escape sequences

Installation

Neovim (with nvim-treesitter)

lazy.nvim

{
  "nvim-treesitter/nvim-treesitter",
  build = ":TSUpdate",
  config = function()
    local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
    parser_config.toon = {
      install_info = {
        url = "https://github.com/DanEscher98/tree-sitter-toon",
        files = { "src/parser.c", "src/scanner.c" },
        branch = "main",
      },
      filetype = "toon",
    }

    require("nvim-treesitter.configs").setup({
      ensure_installed = { "toon" },
      highlight = { enable = true },
    })
  end,
}

packer.nvim

use {
  "nvim-treesitter/nvim-treesitter",
  run = ":TSUpdate",
  config = function()
    local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
    parser_config.toon = {
      install_info = {
        url = "https://github.com/DanEscher98/tree-sitter-toon",
        files = { "src/parser.c", "src/scanner.c" },
        branch = "main",
      },
      filetype = "toon",
    }

    require("nvim-treesitter.configs").setup({
      ensure_installed = { "toon" },
      highlight = { enable = true },
    })
  end,
}

vim-plug

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}

Then in your init.lua:

local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.toon = {
  install_info = {
    url = "https://github.com/DanEscher98/tree-sitter-toon",
    files = { "src/parser.c", "src/scanner.c" },
    branch = "main",
  },
  filetype = "toon",
}

require("nvim-treesitter.configs").setup({
  ensure_installed = { "toon" },
  highlight = { enable = true },
})

File Type Detection

Add to your Neovim config:

vim.filetype.add({
  extension = {
    toon = "toon",
  },
})

Manual Installation (CLI)

npm install
npm run generate
npm test

Usage

Parsing a File

npx tree-sitter parse example.toon

Running Tests

npm test

Example

# Simple object
name: Alice
age: 30
active: true

# Tabular array
users[3]{id,name,role}:
  1,Alice,admin
  2,Bob,user
  3,Charlie,guest

# Nested object
config:
  database:
    host: localhost
    port: 5432
  features:
    - logging
    - metrics

Query Files

The grammar includes query files for full nvim-treesitter integration:

highlights.scm

Syntax highlighting with standard Neovim capture groups:

| Node Type | Capture Group | |-----------|---------------| | null, true, false | @constant.builtin, @boolean | | number, integer | @number | | quoted_string, unquoted_string | @string | | escape_sequence | @string.escape | | identifier (in keys) | @property | | :, ,, \|, . | @punctuation.delimiter | | [, ], {, } | @punctuation.bracket | | - (list marker) | @punctuation.special |

folds.scm

Code folding support for:

  • Nested objects (pair with object value)
  • Array declarations with content
  • Root arrays with content
  • List items with nested objects

indents.scm

Auto-indentation for:

  • Nested objects
  • Array content blocks
  • List items with nested content

locals.scm

Scope and definition tracking for:

  • Objects as scopes
  • Keys as local definitions
  • Field names as definitions

License

MIT