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 🙏

© 2025 – Pkg Stats / Ryan Hefner

parsecco

v1.5.2

Published

parsecco is a parser combinator library

Downloads

29

Readme

parsecco

Parsecco is a parser combinator library for Typescript. It has no dependencies!

Features

  • Includes many of the parsers you know and love, like item, bind, and sat, but also includes a number of much faster hand-optimized parsers.
  • All parsers are written in generator-style, which makes them compatible with cooperative multitasking.
  • Actively maintained. I am happy to accept issues and pull requests!

Installing

You can download Parsecco from NPM. To install it in your NPM project:

$ npm install --save parsecco

Documentation

We provide auto-generated TSDoc documentation from the comments that preface every function. I was a little OCD about this-- every function should be well documented. If you find issues with the documentation, please open an issue.

TSDoc documentation can be found here

(todo) I plan to add tutorial documentation here in the near future.

In the meantime, if you are familiar with the Monadic Parser Combinators paper by Meijer and Hutton, Parsecco is very much in that vein with a few small caveats:

  1. I don't use unpronounceable names for parsers (come on, people!). If you don't like my names, too bad.
  2. My choice combinator is an ordered choice that returns the first match instead of all matches (in other words, it is +++ and not ++ in Meijer and Hutton-speak).
  3. TypeScript has no language-level support for lazy evaluation, so recursive grammar definitions need to be forward-declared. See the recParser family of functions; these were inspired by FParsec's approach.

Usage Examples

If you're looking for real-world usage examples, have a look at the paraformula parser for parsing Microsoft Excel formulas.

Developer Info

Contributions to Parsecco are welcome. If you would like to set up a developer environment, do the following steps:

  1. Check out this repository.
  2. Install development dependencies with
    $ npm install
  3. Then build the library with
    $ npm run build

Please submit patches by pull request. Be sure that your patch passes all the tests (see below), and if your modification also needs testing, submit additional tests.

TypeScript and TypeDoc versions

The current version of Parsecco is was developed and tested with TypeScript 4.2.3 and TypeDoc 0.20.34.

Test Suite

An exhaustive test suite comes with Parsecco, and most of the dev dependencies are to the support the library's test suite. You can run the tests with:

$ npm test

You can run a specific test with

$ npm test -- --grep "a substring from the 'describe' or 'it' field you want to run"