@oxidation-compiler/napi
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

The JavaScript Oxidation Compiler

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

TypeScript typings for the AST is currently work in progress.

cjs

const oxc = require("@oxidation-compiler/napi");
const assert = require('assert');

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

test(oxc.parseSync("foo"));

async function main() {
  test(await oxc.parseAsync("foo"));
}

main()

ESM

import oxc from '@oxidation-compiler/napi';
import assert from 'assert';

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

test(oxc.parseSync("foo"));

async function main() {
  test(await oxc.parseAsync("foo"));
}

main()

Readme

Keywords

none

Package Sidebar

Install

npm i @oxidation-compiler/napi

Weekly Downloads

234

Version

0.2.0

License

MIT

Unpacked Size

10 kB

Total Files

4

Last publish

Collaborators

  • boshen