oxc/wasm/parser
2024-01-30 21:57:46 +08:00
..
src feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00
.gitignore feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00
Cargo.toml feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00
package.json Release @oxc-parser/wasm v0.0.3 2024-01-30 21:57:46 +08:00
pnpm-lock.yaml feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00
README.md feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00

About

Experimental wasm package for the oxc parser, with full TypeScript typings support.

This package is built with wasm-pack build --release --target web for bundler (webpack / vite) consumption. Checkout oxc-parser for usage in node.js.

Source code: https://github.com/oxc-project/oxc/tree/main/wasm/parser

🚴 Usage

import initWasm, { parseSync } from "@oxc-parser/wasm";

async function main() {
  await initWasm();

  const code = "let foo";
  const result = parseSync(code, { filename: "test.ts" });
  console.log(result);
}

main();