skillfed

lark-js

An extension to Lark that generates a Javascript standalone

lark-js v0.1.4 74.0K downloads/30d#14,890 on PyPI88
Permissive license MIT DORMANT released

What it is and what it does

Lark-js is a Python package that acts as a command-line compiler for Lark grammars, converting `.lark` grammar files into standalone Javascript parsers. It is a port of the Lark parsing toolkit from Python to Javascript, using LALR(1) parsing to guarantee linear-time performance. The generated parsers build parse trees automatically and work in both Node.js and browsers.

The package is primarily a build tool: you install it on Python, write or reuse a Lark grammar file (which is language-agnostic EBNF), and run the `lark-js` command to produce a ready-to-use Javascript parser. The grammar syntax is portable across Python, Javascript, and Julia implementations of Lark, so you can share grammar definitions across projects in different languages.

Use it for:

  • Generate a Javascript parser from an existing Lark grammar to embed parsing logic in a web application or Node.js service
  • Port a Python project that uses Lark to Javascript while reusing the same grammar file unchanged
  • Build a domain-specific language (DSL) parser in Javascript without hand-coding the parser logic
  • Create interactive parsing tools or IDE-like features in the browser using Lark's step-by-step parsing capability

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Lark-js is a command-line tool that generates standalone LALR(1) parsers in Javascript from Lark grammar files, enabling portable grammar-based parsing across Python, Javascript, and Julia.

Yes, if you need to generate a Javascript parser from a Lark grammar and are comfortable with a dormant package. The tool is stable (Beta status, no known vulnerabilities), has low install friction, and solves a specific problem well. The 1551-day gap since last release is a concern for long-term maintenance, but the repository is not archived and the transpilation approach means it inherits Lark's stability. Install only if you actively need grammar-based parsing in Javascript.

Install

lark-js on PyPI

pip

pip install lark-js

uv

uv add lark-js

poetry

poetry add lark-js

Installing lark-js

Before you install

Low install friction with a single pure-Python dependency. The package is dormant (last release 2022-05-16, 1551 days ago) but the repository remains active and unarchived; maintenance is minimal but not abandoned.

License in practice

MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you retain the license notice.

Quickstart

pip install lark-js
lark-js my_grammar.lark -o my_parser.js

Verify before relying

  • Whether the transpiled Javascript output remains compatible with current Node.js and browser environments
  • Current state of the 98% auto-transpilation claim and whether Python-side Lark updates actually sync to this package

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — lark
Maintenance dormant — 1,551 days since the last release
Last repo commit
First released
Downloads 74,014/month — #14,890 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: Lark_js-0.1.4-py2.py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: GeneralTopic :: Text Processing :: Linguistic

Tags

javascript parser generatorlalr parser from grammarlark grammar to javascriptebnf parser compilerportable parsing toolkit
parser-generatorgrammar-compiler

More Python Modules packages