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

@shumoku/netbox

v0.2.25

Published

NetBox API client and Shumoku converter

Readme

@shumoku/netbox

NetBox API client and converter for Shumoku network diagrams.

Installation

npm install @shumoku/netbox

Usage

As a Library

import { NetBoxClient, convertToShumoku } from '@shumoku/netbox'

// Create client
const client = new NetBoxClient({
  url: 'https://netbox.example.com',
  token: 'your-api-token'
})

// Fetch devices and convert to Shumoku format
const devices = await client.getDevices()
const cables = await client.getCables()

const graph = convertToShumoku({ devices, cables })

As a CLI

# Convert NetBox data to Shumoku YAML
npx netbox-to-shumoku --url https://netbox.example.com --token YOUR_TOKEN

# Output to file
npx netbox-to-shumoku --url https://netbox.example.com --token YOUR_TOKEN -o network.yaml

# Generate SVG with legend
npx netbox-to-shumoku --url https://netbox.example.com --token YOUR_TOKEN --legend -o network.svg

# Export as NetworkGraph JSON (for integration with other tools)
npx netbox-to-shumoku --url https://netbox.example.com --token YOUR_TOKEN -f json -o network.json

CLI Options

| Option | Description | |--------|-------------| | -u, --url <url> | NetBox API URL (or set NETBOX_URL env var) | | -t, --token <token> | API token (or set NETBOX_TOKEN env var) | | -k, --insecure | Skip TLS certificate verification (for self-signed certs) | | -f, --format <type> | Output format: yaml, json, svg, html (default: auto from extension) | | -o, --output <file> | Output file (default: topology.yaml) | | --theme <theme> | Theme: light or dark (default: light) | | -s, --site <slug> | Filter by site slug | | -r, --role <slug> | Filter by device role slug | | --status <status> | Filter by status | | --tag <slug> | Filter by tag slug | | -g, --group-by <type> | Group by: tag, site, location, prefix, none | | --no-ports | Don't include port names in links | | --no-colors | Don't color links by cable type | | --color-by-status | Color devices by their status | | --legend | Show legend in the diagram (SVG only) | | -d, --debug | Show debug output (API requests/responses) |

Integration Workflow

Export NetBox data as JSON, merge with custom data, then render:

# Step 1: Export from NetBox as JSON
npx netbox-to-shumoku -f json -o netbox.json

# Step 2: Merge or modify the JSON with your custom data (via script)
# The JSON follows the NetworkGraph schema

# Step 3: Render the final JSON to SVG or HTML
npx shumoku render merged.json -o diagram.html

API

NetBoxClient

const client = new NetBoxClient({
  url: string,      // NetBox URL
  token: string,    // API token
  debug?: boolean   // Enable debug output (default: false)
})

// Methods
client.getDevices(): Promise<NetBoxDevice[]>
client.getCables(): Promise<NetBoxCable[]>
client.getSites(): Promise<NetBoxSite[]>

convertToShumoku

import { convertToShumoku } from '@shumoku/netbox'

const graph = convertToShumoku({
  devices: NetBoxDevice[],
  cables: NetBoxCable[],
  sites?: NetBoxSite[]
})

Related Packages

License

MIT