0.0.12 • Published 2 years ago

@wapc/widl v0.0.12

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Web Assembly IDL (widl) Parser

This library will parse .widl files into an AST. Refer to the docs docs for more information.

Installation

$ npm install @wapc/widl

Usage (node)

const widl = require("@wapc/widl");

const source = `
namespace "mandelbrot"

interface {
  update(width: u32, height: u32, limit: u32): [u16]
}`;

const doc = widl.parse(source, { noLocation: true });

console.log(JSON.stringify(doc));

Usage (browser)

<script
  type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/@wapc/widl/dist/standalone.min.js"
></script>
<script type="text/javascript">
  const source = `
namespace "mandelbrot"

interface {
  update(width: u32, height: u32, limit: u32): [u16]
}`;

  const doc = widl.parse(source, { noLocation: true });

  console.log(JSON.stringify(doc));
</script>

License

Apache License 2.0

0.0.12

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago