oxc-parser
TypeScript icon, indicating that this package has built-in type declarations

0.36.0 • Public • Published

The JavaScript Oxidation Compiler

See index.d.ts for parseSync and parseAsync API.

import assert from 'assert';
import oxc from 'oxc-parser';

const sourceText = "let foo: Foo = 'foo';";
// Filename extension is used to determine which
// dialect to parse source as
const options = { sourceFilename: 'text.tsx' };

test(oxc.parseSync(sourceText, options));
test(await oxc.parseAsync(sourceText, options));

function test(ret) {
  assert(ret.program.body.length == 1);
  assert(ret.errors.length == 0);
}

Readme

Keywords

Package Sidebar

Install

npm i oxc-parser

Homepage

oxc.rs

Weekly Downloads

5,299

Version

0.36.0

License

MIT

Unpacked Size

16.2 kB

Total Files

6

Last publish

Collaborators

  • boshen