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

@wokwi/diagram-lint

v0.1.1

Published

Linter for Wokwi diagram.json files

Downloads

15

Readme

@wokwi/diagram-lint

Linter for Wokwi diagram.json files. Catches common issues like invalid pins, missing components, and duplicate IDs.

Installation

npm install @wokwi/diagram-lint

Usage

import { DiagramLinter } from '@wokwi/diagram-lint';

const linter = new DiagramLinter();
const result = linter.lint(diagram);

if (!result.valid) {
  for (const issue of result.issues) {
    console.error(`[${issue.severity}] ${issue.rule}: ${issue.message}`);
  }
}

Rules

| Rule | Severity | Description | | ------------------- | -------- | ------------------------------------------ | | duplicate-id | error | Parts with duplicate IDs | | invalid-pin | error | Connections using non-existent pins | | missing-component | error | Connections referencing non-existent parts | | unknown-part-type | error | Unknown part types | | wrong-coord-names | error | Using x/y instead of left/top | | invalid-attribute | warning | Unknown or invalid attributes | | misplaced-coords | warning | top/left inside attrs | | redundant-parts | warning | Parts with no connections | | unsupported-part | info | Parts not in official documentation |

Configuration

const linter = new DiagramLinter({
  rules: {
    'redundant-parts': false, // disable rule
    'invalid-attribute': { severity: 'error' }, // change severity
  },
});

Loading Latest Board Definitions

The linter includes built-in board definitions, but you can load the latest definitions at runtime from the wokwi-boards bundle:

import { DiagramLinter } from '@wokwi/diagram-lint';

const linter = new DiagramLinter();

// Fetch and load the latest board definitions
const bundle = await fetch('https://wokwi.github.io/wokwi-boards/boards.json').then((r) =>
  r.json(),
);
const count = linter.getRegistry().loadBoardsBundle(bundle);
console.log(`Loaded ${count} boards`);

// Now lint with the latest board pin definitions
const result = linter.lint(diagram);

Adding Parts

Part definitions are in src/registry/parts/. To add or update a part:

  1. Edit the JSON file in src/registry/parts/wokwi-<part-name>.json
  2. Run npm run build:parts to regenerate parts.json

License

The MIT License (MIT)