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

@embedded32/j1939

v1.0.1

Published

TypeScript SAE J1939 stack for learning and simulation (PGN, SPN, diagnostics, transport subset)

Readme

@embedded32/j1939

Educational SAE J1939 helpers for Embedded32: 29-bit ID parsing, a partial PGN catalog, message decoding, diagnostics subset, and CAN gateway bindings.

Scope: This is a learning-oriented subset - not a complete or certified J1939 stack.

Installation

npm install @embedded32/j1939 @embedded32/can

Minimum runnable example

import { parseJ1939Id, decodeJ1939, buildJ1939Id } from '@embedded32/j1939';

const parsed = parseJ1939Id(0x18f00401);
console.log(parsed.pgn, parsed.sa);

const msg = decodeJ1939({
  id: 0x18f00401,
  data: [0, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70],
  extended: true,
});
console.log(msg.name);

const id = buildJ1939Id({ priority: 6, pgn: 0xf004, sa: 0x00 });

Full walkthrough: examples/j1939-basic.ts - npx tsx examples/j1939-basic.ts

Public API overview

| Export | Role | | ----------------------------------- | ------------------------------------------------ | | parseJ1939Id, buildJ1939Id | 29-bit identifier math | | decodeJ1939, formatJ1939Message | Frame → structured message | | getPGNInfo | Catalog metadata for known PGNs | | J1939TransportProtocol | Multi-packet subset (BAM/RTS - partial coverage) | | DiagnosticsManager | DM1/DM2-oriented helpers | | J1939CANBinding | Connect CAN traffic to a runtime message bus | | AddressClaimManager | Address-claim teaching utilities |

Runtime requirements

  • Node.js 18+
  • ESM imports
  • @embedded32/can when using CAN bindings or examples with frames

Hardware requirements

None for parse/decode examples. SocketCAN optional when using J1939CANBinding with real interfaces.

Browser compatibility

Decode functions are pure TypeScript and may be bundled for browser demos. SocketCAN and Node-only bindings are not browser-compatible.

Common errors

| Error | Fix | | ----------------------------- | ------------------------------------------------------------ | | unknown PGN / sparse decode | PGN not in catalog - check getPGNInfo | | Wrong priority/SA | Confirm hex ID (0x18F00401) and extended: true on frames | | Import J1939Id namespace | Use parseJ1939Id / buildJ1939Id functions instead |

Related packages

  • @embedded32/can - frame transport
  • @embedded32/sim - ECUs that emit J1939 traffic
  • @embedded32/tools - simulate and j1939 monitor commands
  • @embedded32/sdk-js - application-level J1939 client

Version compatibility

Use @embedded32/[email protected] with matching @embedded32/[email protected]. Transport and diagnostics APIs may expand in minor releases without breaking parse/decode.

License

MIT © Mukesh Mani Tripathi