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

@emdzej/ediabasx-host-config

v0.7.1

Published

Shared loader for ~/.config/ediabasx/config.json + interface-selection resolver. Consumed by @emdzej/ediabasx-cli and external CLIs that drive ediabasx (e.g. nfsx) so the config schema + override rules stay in one place.

Downloads

1,545

Readme

@emdzej/ediabasx-host-config

Shared loader, saver, and selection-resolver for ~/.config/ediabasx/config.json — consumed by @emdzej/ediabasx-cli and intended for any other host that wants to interoperate with the same config file (e.g. nfsx-cli).

Pure data: no logger, no interface factory, no Node-only side effects beyond fs.

Use

import {
  DEFAULT_CONFIG_PATH,
  loadConfig,
  saveConfig,
  resolveSelection,
  parseGatewayAddress,
} from '@emdzej/ediabasx-host-config';

// Load the user's saved config (returns undefined if no file).
const file = loadConfig();

// Resolve the active interface selection — CLI flags override file
// config, file config provides defaults, options only inherit when the
// resolved interface matches what the file was configured for.
const selection = resolveSelection({
  fileConfig: file,
  cliInterface: 'j2534',
  fallback: 'simulation',
  cliOptions: { hostInterByteMs: '5' },
});
// → { name: 'j2534', options: { hostInterByteMs: '5', ... } }

// Save updated config.
saveConfig({ interface: 'j2534', options: { protocol: 'ds2' } });

SGBD resolution

The resolveSgbd function resolves bare ECU names (e.g. "IKE") to file paths using the configured sgbdPath. Used by the server, EmbeddedEdiabas, and the CLI run command.

import { resolveSgbd } from "@emdzej/ediabasx-host-config";

// Bare name → searches sgbdPath for IKE.prg, IKE.PRG, IKE.grp, IKE.GRP
const path = resolveSgbd("IKE", "/path/to/ecu/files");

// File path or name with extension → returned as-is (resolved against sgbdPath)
const path2 = resolveSgbd("MS430DS0.prg", "/path/to/ecu/files");

// Path with separators → resolved against cwd, sgbdPath ignored
const path3 = resolveSgbd("./custom/IKE.prg", undefined);

Server config

The config file supports an optional server block for ediabasx serve:

{
  "interface": "kdcan",
  "options": { "port": "/dev/cu.usbserial-A50285BI" },
  "sgbdPath": "/path/to/ecu/files",
  "server": {
    "host": "0.0.0.0",
    "port": 6802,
    "transport": "websocket"
  }
}

sgbdPath is a top-level field — shared by the server, EmbeddedEdiabas, and the CLI run command for bare ECU name resolution.

The inheritance rule

The most important nuance: when CLI flags pick a different interface than the saved file, the file's options block is NOT inherited. Otherwise a saved serial protocol: "uart" would leak into a j2534 selection that doesn't accept that value. The resolver only carries over file options when fileConfig.interface === resolvedName.

See also