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

@tscircuit/checks

v0.0.117

Published

Validity check functions. These functions generally take [a tscircuit json array](https://github.com/tscircuit/soup) and output an array of arrays for any issues found.

Readme

@tscircuit/checks

Validity check functions. These functions generally take a tscircuit json array and output an array of arrays for any issues found.

Getting Started Contributor Video

Function Overview

| Function | Description | | --- | --- | | checkConnectorAccessibleOrientation | Returns pcb_accessibility_error for connectors whose orientation makes them inaccessible. | | checkAllPinsInComponentAreUnderspecified | Returns source_component_pins_underspecified_warning when every pin on a chip lacks pin attributes. | | checkNoPowerPinDefined | Returns source_no_power_pin_defined_warning when a chip has no pin with requires_power=true. | | checkNoGroundPinDefined | Returns source_no_ground_pin_defined_warning when a chip has no pin with requires_ground=true. | | checkDifferentNetViaSpacing | Returns pcb_via_clearance_error if vias on different nets are too close together. | | checkEachPcbPortConnectedToPcbTraces | Returns pcb_trace_error if any source_port is not connected to its corresponding PCB traces. | | checkEachPcbTraceNonOverlapping | Returns pcb_trace_error when pcb_trace segments overlap incompatible geometry on the same layer. | | checkPcbComponentOverlap | Returns pcb_footprint_overlap_error when footprint elements from different components overlap in disallowed ways. | | checkPcbComponentsOutOfBoard | Returns pcb_placement_error when PCB components do not fit inside the board area. | | checkPcbTracesOutOfBoard | Returns pcb_trace_error when any trace segment or via extends beyond the board boundary. | | checkPinMustBeConnected | Returns pcb_trace_error when required source pins are not connected. | | checkSameNetViaSpacing | Returns pcb_via_clearance_error if vias on the same net are closer than the allowed margin. | | checkSourceTracesHavePcbTraces | Returns pcb_trace_error when source traces are missing corresponding pcb_trace routes. | | checkTracesAreContiguous | Returns pcb_trace_error when trace endpoints are floating or do not connect as expected. | | checkViasOffBoard | Returns pcb_placement_error if any PCB via lies outside or crosses the board boundary. |

Aggregate check runner functions

| Function | Description | | --- | --- | | runAllPlacementChecks | Runs all placement checks (checkViasOffBoard, checkPcbComponentsOutOfBoard, checkPcbComponentOverlap, and checkConnectorAccessibleOrientation). | | runAllNetlistChecks | Runs netlist connectivity checks (currently checkPinMustBeConnected). | | runAllPinSpecificationChecks | Runs pin specification checks (e.g. checkAllPinsInComponentAreUnderspecified, checkNoPowerPinDefined, and checkNoGroundPinDefined). | | runAllRoutingChecks | Runs all routing checks currently enabled (checkEachPcbPortConnectedToPcbTraces, checkSourceTracesHavePcbTraces, checkEachPcbTraceNonOverlapping, same/different net via spacing, and checkPcbTracesOutOfBoard). | | runAllChecks | Runs placement, netlist, pin specification, and routing checks and returns a combined list of issues. |

Implementation Details

[!NOTE] It can be helpful to look at an example soup file

tscircuit soup JSON array containing elements. For checks involving source ports, and pcb traces here are the relevant elements (the types are produced below)

[!NOTE] For the most up-to-date types, check out @tscircuit/soup

// You can import these types from the @tscircuit/soup package e.g.
// import type { PCBPort, PCBTrace, AnySoupElement } from "circuit-json"

import { z } from "zod"
import { distance } from "../units"

export const pcb_trace = z.object({
  type: z.literal("pcb_trace"),
  source_trace_id: z.string().optional(),
  pcb_component_id: z.string().optional(),
  pcb_trace_id: z.string(),
  route: z.array(
    z.union([
      z.object({
        route_type: z.literal("wire"),
        x: distance,
        y: distance,
        width: distance,
        start_pcb_port_id: z.string().optional(),
        end_pcb_port_id: z.string().optional(),
        layer: z.string(),
      }),
      z.object({
        route_type: z.literal("via"),
        x: distance,
        y: distance,
        from_layer: z.string(),
        to_layer: z.string(),
      }),
    ])
  ),
})

export type PCBTraceInput = z.input<typeof pcb_trace>
export type PCBTrace = z.output<typeof pcb_trace>

import { distance } from "../units"
import { layer_ref } from "./properties/layer_ref"

export const pcb_port = z
  .object({
    type: z.literal("pcb_port"),
    pcb_port_id: z.string(),
    source_port_id: z.string(),
    pcb_component_id: z.string(),
    x: distance,
    y: distance,
    layers: z.array(layer_ref),
  })
  .describe("Defines a port on the PCB")

export type PCBPort = z.infer<typeof pcb_port>
export type PCBPortInput = z.input<typeof pcb_port>

export const source_port = z.object({
  type: z.literal("source_port"),
  pin_number: z.number().optional(),
  port_hints: z.array(z.string()).optional(),
  name: z.string(),
  source_port_id: z.string(),
  source_component_id: z.string(),
})

export type SourcePort = z.infer<typeof source_port>

export const source_net = z.object({
  type: z.literal("source_net"),
  source_net_id: z.string(),
  name: z.string(),
  member_source_group_ids: z.array(z.string()),
  is_power: z.boolean().optional(),
  is_ground: z.boolean().optional(),
  is_digital_signal: z.boolean().optional(),
  is_analog_signal: z.boolean().optional(),
})

export type SourceNet = z.infer<typeof source_net>
export type SourceNetInput = z.input<typeof source_net>

import { z } from "zod"

export const pcb_trace_error = z
  .object({
    pcb_error_id: z.string(),
    type: z.literal("pcb_error"),
    error_type: z.literal("pcb_trace_error"),
    message: z.string(),
    pcb_trace_id: z.string(),
    source_trace_id: z.string(),
    pcb_component_ids: z.array(z.string()),
    pcb_port_ids: z.array(z.string()),
  })
  .describe("Defines a trace error on the PCB")

export type PCBTraceErrorInput = z.input<typeof pcb_trace_error>
export type PCBTraceError = z.infer<typeof pcb_trace_error>