SkillAgentSearch skills...

Okapi

A lightweight performant JavaScript parser for Rust and WebAssembly

Install / Use

/learn @thegreatercurve/Okapi
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Okapi JS Parser

[!NOTE] This is a parser is still a work-in-progress and should not be used in production.

A lightweight but production-grade JavaScript parser for Rust and WebAssembly.

The library fully supports ECMAScript 2024 and it outputs it's Abstract Syntax Tree (AST) as either normal ESTree compliant structs or as JSON using serde_json.

ESTree is a community-maintained and widely-used standard for ASTs, and is the same output as most other JavaScript parsers.

Below are listed some of the aims and achievements of this project:

Usage

use okapi_js_parser::Parser;

let source_str: &str = ...

let mut parser = Parser::new(source_str);

match parser.parse_script() {
    Ok(program) => ...,
    Err(err) => ...,
}

Tests

To run the local parser and lexer tests:

cargo test

To run the tests for Test262:

cargo run -p okapi_test262

Playground

The local web playground to test the parser functionality can be found in ./playground.

Instructions on how to set-up the playground can be found in the associated README.md.

View on GitHub
GitHub Stars22
CategoryDevelopment
Updated7mo ago
Forks0

Languages

JavaScript

Security Score

82/100

Audited on Aug 16, 2025

No findings