0.4.6 • Published 4 months ago

rs1090-wasm v0.4.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

rs1090-wasm

A WASM binding for the rs1090 library.

For the moment, only the decode function is wrapped.

Installation

Just run the following (or similar with your favourite package manager):

npm install rs1090-wasm

Loading

Loading is much more complicated. It depends on your environment.

We offer three subpackages:

  • ES modules (default). It loads WASM in a way that will be bundled into a single file if you use dynamic imports, or embedded into your main bundle if you use regular imports.
  • CommonJS (for node). It loads WASM using node's fs module, synchronously. Not really designed for bundling or shipping to the browser.
  • web: more customizable. This one is for when you need to load the WASM in some totally custom way.

These sub-packages are named rs1090-wasm, rs1090-wasm/nodejs, and rs1090-wasm/web, respectively.

Detailed explanations available for another library here (used as reference for the packaging)

Observable

In the Observable platform, you have to import the web library in a little convoluted way:

rs1090 = {
  let module = await import("https://unpkg.com/rs1090-wasm/web/rs1090_wasm.js");
  await module.default("https://unpkg.com/rs1090-wasm/web/rs1090_wasm_bg.wasm");
  module.run(); // get better error messages if the Rust code panics
  return module;
}

You can also just simply:

import { rs1090 } from "@xoolive/rs1090";
0.4.6

4 months ago

0.4.5

4 months ago

0.4.4

6 months ago

0.4.3

6 months ago

0.4.2

7 months ago

0.4.1

7 months ago