#ads-b #modes #aircraft #decoding

rs1090-wasm

A real-time comprehensive Mode S and ADS-B data decoder

11 releases

new 0.4.13 Apr 1, 2025
0.4.12 Apr 1, 2025
0.4.8 Mar 21, 2025
0.4.4 Jan 12, 2025
0.4.2 Dec 29, 2024

#406 in WebAssembly

Download history 93/week @ 2024-12-29 10/week @ 2025-01-05 255/week @ 2025-01-12 9/week @ 2025-01-19 1/week @ 2025-02-02 4/week @ 2025-02-23 7/week @ 2025-03-02 214/week @ 2025-03-09 247/week @ 2025-03-16 37/week @ 2025-03-23 373/week @ 2025-03-30

871 downloads per month

MIT license

6.5MB
8K SLoC

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";

Dependencies

~8–17MB
~212K SLoC