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

@muigui/tendril

v1.0.1

Published

muigui | Tendril

Downloads

62

Readme

@muigui/tendril

Tendril is a lightweight parsing library that converts text documents into a flat Abstract Syntax Tree (AST). Unlike traditional parsers that rely heavily on deeply nested trees, Tendril uses a linear stream of nodes to represent document structure and content.

The Core Concept: Flat Stream AST

Aside from the top-level ASTNode, Tendril's AST is entirely flat.

It represents document structures using matching boundary markers instead of parent-child nesting:

  • Structure Spans: Represented by explicit New and End nodes; and
  • Text Content: Represented by standard Token nodes containing the literal text.

The Problem Tendril Solves: Overlapping Structures

Traditional parsers force text into strict hierarchical trees. This design breaks down when dealing with real-world formatting that naturally overlaps.

The Quote Dilemma

A classic example is a dialogue quote that starts in the middle of one paragraph, spans across a second paragraph, and ends inside a third paragraph.

  • Traditional Parsers: Cannot easily represent this because a Quote node cannot be both a child of Paragraph 1 and a parent of Paragraph 2 without duplicating data or breaking XML/JSON tree validation rules.
  • Tendril's Solution: Because Tendril uses a flat stream, it handles this effortlessly. Boundary markers simply appear exactly where they occur in the text flow, completely bypassing the nesting restriction.

For example the following text:

He turned to face them.

Suddenly, he yelled, "Run!

Don't just stand there!

I said run!", with the ferocity of a drill sergeant.

They all just stood there, fingers in each others' noses.

Would be parsed as:

[Document.new()] 
  [Paragraph.new()] 
    [Token("He"] 
    [Token(" "] 
    [Token("turned"] 
    [Token(" "] 
    [Token("to"] 
    [Token(" "] 
    [Token("face"] 
    [Token(" "] 
    [Token("them"] 
    [Token("."] 
  [Paragraph.end("\n")]
  [Paragraph.new("\n")] 
    [Token("Suddenly"] 
    [Token(","] 
    [Token(" "] 
    [Token("he"] 
    [Token(" "] 
    [Token("yelled"] 
    [Token(","] 
  [Quote.new('"')] 
    [Token("Run"] 
    [Token("!"] 
  [Paragraph.end("\n")]
  [Paragraph.new("\n")] 
    [Token("Don't"] 
    [Token(" "] 
    [Token("just"]  
    [Token(" "] 
    [Token("stand"] 
    [Token(" "] 
    [Token("there"] 
    [Token("!"] 
  [Paragraph.end("\n")]
  [Paragraph.new("\n")]
    [Token("I"] 
    [Token(" "] 
    [Token("said"] 
    [Token(" "] 
    [Token("run"] 
    [Token("!"]  
  [Quote.end('"')] 
    [Token(","] 
    [Token(" "] 
    [Token("with"]
    [Token(" "] 
    [Token("the"] 
    [Token(" "] 
    [Token("ferocity"] 
    [Token(" "] 
    [Token("of"] 
    [Token(" "] 
    [Token("a"] 
    [Token(" "] 
    [Token("drill"]
    [Token(" "] 
    [Token("sergeant"] 
    [Token("."] 
  [Paragraph.end("\n")]
  [Paragraph.new("\n")]
    [Token("They"] 
    [Token(" "] 
    [Token("all"] 
    [Token(" "] 
    [Token("just"] 
    [Token(" "] 
    [Token("stood"] 
    [Token(" "] 
    [Token("there"] 
    [Token(","] 
    [Token(" "] 
    [Token("fingers"] 
    [Token(" "] 
    [Token("in"] 
    [Token(" "] 
    [Token("each"] 
    [Token(" "] 
    [Token("others"] 
    [Token("'"] 
    [Token(" "] 
    [Token("noses"] 
    [Token("."] 
  [Paragraph.end()]
[Document.end()] 

Features

  • Flat Architecture: Zero recursive tree traversal required to read or manipulate the document timeline.
  • Overlapping Support: Natively handles quotes, formatting, or annotations that cross paragraph or sentence boundaries.
  • Simple Stream Processing: Ideal for pipe-based transformations, rendering engines, and linear text analysis.
  • Language Support: Version 1.0 officially supports English text documents.

This flat/linear stream allows Tendril to easily represent not only nested structures, but also overlapping structures — E.g. quoted text that spans multiple sentences, lines, and/or paragraphs — without the need for hacks and/or workarounds.