0.2.0 • Published 2 years ago

@oxidation-compiler/napi v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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()
0.1.0

2 years ago

0.2.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago