JSPM

  • Created
  • Published
  • Downloads 574285
  • Score
    100M100P100Q232264F
  • License MIT

Oxc Parser Node API

Package Exports

  • oxc-parser
  • oxc-parser/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (oxc-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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);
}