npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@canboat/wasm

v8.3.0

Published

WebAssembly build of the canboat NMEA 2000 decoder/encoder — the canboat wire brain as a pure-npm, in-process package.

Readme

@canboat/wasm

The canboat NMEA 2000 decoder/encoder compiled to WebAssembly. It runs in-process as an ordinary npm dependency, with no native addon to build and no binary to download.

The Rust source is the same source the native canboat binary is built from, here targeting wasm32-unknown-unknown. One codebase, two build targets.

Install

npm install @canboat/wasm

The package version names the canboat release it compiles, so @canboat/[email protected] carries the wire brain from canboat v8.0.0-beta3.

Parity

Checked against the canboat and Signal K test harnesses:

  • RX output is byte-identical to native canboat convert over a 7595-record live NMEA 2000 capture.
  • Signal K deltas match the native analyzer baseline across the canboatjs test corpus.
  • TX output matches the native encoder on every corpus object both can encode, with 1311/1311 canName byte parity against canboatjs toPgn.

The wasm binary is 1.55 MB (about 530 KB gzipped). Decoding costs roughly 5 µs per line in-process, which is about 2.8× faster than canboatjs and faster than the native binary run as a child process, since that pays pipe overhead.

API

TypeScript types are included. The package is ESM-first with a CJS build, so import and require both work.

import { Decoder, encodeToPlain, encodeData, version } from "@canboat/wasm";

// Stateful line decoder: plain ("Actisense serial"), YDWG RAW,
// iKonvert, Actisense ASCII … lines in (format sniffed like the
// native reader), analyzer-shaped JSON out.
//            camel  name-value  SI    coalesced
const d = new Decoder(true, true, true, false);
const json = d.decodeLine(
  "2017-04-15T14:57:58.468Z,7,65359,204,255,8,3b,9f,ff,ff,ff,18,60,ff",
);
// -> '{"seatalkPilotHeading":{...,"description":"Seatalk: Pilot Heading",...}}'

// JSON record (canboatjs or analyzer dialect) -> wire
const line = encodeToPlain(JSON.stringify(pgnObject), true);
const bytes = encodeData(JSON.stringify(pgnObject), true); // Uint8Array of the PGN payload

Set coalesced to true when every line is a complete record, which is what the native converter assumes for plain text such as logs written by the canboat gateway readers. Setting it to false applies the canboatjs convention, where lines with exactly 8 payload bytes go through fast-packet reassembly.

canboatjs-compatibility shim

import { FromPgn, toPgn, pgnToActisenseSerialFormat } from "@canboat/wasm";

These cover the surface most consumers use: FromPgn (parseString plus 'pgn' and 'error' events, returning canboatjs-shaped objects), toPgn (a Buffer of payload bytes), and pgnToActisenseSerialFormat.

Scope

This package decodes and encodes. It does no I/O, so moving bytes is left to whatever you already have: node:net for TCP gateways (YDWG, W2K-1, NavLink2, IPG100), serialport for NGT-1 and iKonvert, or an AF_CAN wrapper for socketcan. There is no pure-JS CAN socket, and on hardware CAN buses the native canboat interface still does more for you, including address claiming, the NAME responder, and TX chunking.

For the byte-stream gateways, ByteDecoder ("ngt1", "ikonvert", "maretron-ipg") handles the protocol over whatever carries the bytes: feed it what arrives with decodeBytes, write out initBytes, takePendingTx (the next handshake step), encodeFrame and closeBytes, and call tick about once a second so its timers advance on a quiet link. The protocol code is canboat's own (canboat::codec), the same code the native canboat interface runs.

Building

npm run build      # wasm-pack build --release --target nodejs
npm test           # pinned-vector smoke tests

The crate depends on the canboat library (decode and json-input features, no I/O) at a pinned release. See Cargo.toml.

License

Apache-2.0, © Kees Verruijt, same as canboat.