Casual Parsing in JavaScript

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • parser-combinators

    Parser combinators. (by appliedblockchain)

  • Parser combinators [0] are great for quick parsing, usage from typescript is very neat. You can collapse tokenisation, parsing and some evaluation for simple grammars (they appear in production from time to time) into single parser combinator phase (there’s nothing else) where you get desired, typed result.

    [0] https://github.com/appliedblockchain/parser-combinators

  • yieldparser

    Parse using JavaScript generator functions — it’s like components but for parsing!

  • I’ve found generator functions work great for parsers. You yield the tokens you expect to be next. The token could be a string, a regular expression to be matched, or another generator function.

    The library is open source here, contributions welcome: https://github.com/RoyalIcing/yieldparser

    Generator functions have great support in modern browsers (not IE) and Node.js.

    For example here’s a simple v4 IP address parser:

    import { parse, mustEnd } from 'yieldparser';

    function* Digit() {

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • three-pass-compiler

    Solution to the Three Pass Compiler kata on CodeWars, parsing and manipulating a very simple AST

  • instaparse

  • You might enjoy checking out Instaparse, a Clojure library. Its project page reads, “What if context-free grammars were as easy to use as regular expressions?”

    It’s not over-promising, either. I went from never having heard of it before to getting complete and correct parse trees of some ancient JSP Expression Language in about 20 minutes. Most of that time was spent typing in the BNF description that I could find only in an image.

    https://github.com/Engelberg/instaparse

  • parser

    String parser combinators (by preludejs)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts