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

bramble-parser

v0.5.8

Published

Bramble is a lightweight recursive descent parser that processes .havenfs files, returning a structured Json tree that can be used to construct an in-memory FS representation. The parser is based on line-based grammar, chunk headers, and metadata declarat

Downloads

15

Readme

Bramble Parser

A parser for the .havenfs file format

Introduction

Bramble is a lightweight recursive descent parser that processes .havenfs files, returning a structured Json tree that can be used to construct an in-memory FS representation. The parser is based on line-based grammar, chunk headers, and metadata declarations.

.havenfs files describe the structure of a virtual file system with elements such as files, metadata, directories, references, and git history.


Example Input

A typical .havenfs input file would look like this:

#BRANCH base=main parent=b0011 head=b0012

#CHUNK files 0-999 @0
FILE f1a7e parent=92e1f name=logo.png size=20320 tags=branding,logo
META f1a7e modified=1723472381 created=1723472370 mimetype=image/png

#CHUNK files 1000-1999 @12010
FILE f1b88 parent=92e1f name=screenshot1.png size=50320 libs=a300
META f1b88 modified=1723472381 created=1723472370 mimetype=image/png

#CHUNK libraries @3000
LIB a300 info=b400,b401

#CHUNK tagmap @4500
TAG b401 branding:#8E44AD FR=f1a7e
TAG b402 logo:#1ABC9C FR=f1a7e
TAG b402 bin:#464646
TAG b402 favourite:#A6DB5A

#CHUNK directories @25000
DIR 92e1f parent=root name=images

#CHUNK refs @27000
REF f1a7e to=3d93e type=used-by context=thumbnail

#CHUNK history f1a7e
HIST f1a7e 20250625T1230 user=ellie action=created hash=abc123
HIST f1a7e 20250626T1010 user=ellie action=edited hash=def456

Output

Parsing the above file produces:

  • A JSON structure describing all nodes (files, metadata, directories, etc).
  • A readable debug printout displaying detailed per-node information.

How to Run

You need a package manager like npm, yarn or bun.

Development Script

bun run example

or

npm run example

This will read the example file located at:

fixtures/example.havenfs

Reading .havenfs flat config files from current folder

bun run bramble

or

npm run bramble

Running the Bramble Lexer

bun run lex

or

npm run lex

Parse and debug a .havenfs file located at:

fixtures/example.havenfs

Running Tests

bun test

Project Structure

  • lexer.ts: Tokenizes .havenfs files into structured chunks
  • parser.ts: Implements a predictive parser and builds the file system tree
  • fixtures.ts: Example .havenfs input
  • test.ts: Runs unit tests for lexer and parser