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

@mathlabs/voltik

v1.0.0

Published

CircuiTikZ circuits to SVG and PNG, without a TeX install. A library of tikra; math labels typeset by mathra. Runs on WebAssembly in Node, bundlers and browsers.

Readme

@mathlabs/voltik

CircuiTikZ circuits to SVG and PNG, without a TeX install: no LaTeX, no fonts on the system, no external processes. voltik is a library of tikra, which draws the TikZ; voltik adds the CircuiTikZ components, and labels are set by mathra in Latin Modern, TeX's own Computer Modern.

npm install @mathlabs/voltik

What it draws

Path-style components placed with to[…]: short, open, generic, resistors (R, American and European), capacitors (C) and inductors (L); labels and annotations (l, l_, a, R=label), straight, rotated or smart, with the siunitx shorthand 20<\ohm>; poles o and *; mirror and invert; \ctikzset and the class keys. The specification is the CircuiTikZ manual; what is drawn and what is not yet is in spec/subset.md. Every image below is an SVG written by voltik.

Node

Works right away:

import { circuitikzToSvg, render, png } from "@mathlabs/voltik";      // or: const { circuitikzToSvg } = require("@mathlabs/voltik")
import { writeFileSync } from "node:fs";

const svg = circuitikzToSvg(String.raw`\begin{circuitikz}\draw (0,0) to[R=$R_1$, o-*] (2,0);\end{circuitikz}`);
writeFileSync("r.svg", svg);
writeFileSync("r.png", png(svg, { dpi: 300 }));
const { warnings, alt } = render(String.raw`\begin{circuitikz}\draw (0,0) to[C] (2,0);\end{circuitikz}`);

Browsers and bundlers (Vite, webpack, esbuild)

Await init() once; it fetches voltik.wasm next to the module:

import { init, circuitikzToSvg } from "@mathlabs/voltik";

await init();
document.querySelector("#circuit").innerHTML = circuitikzToSvg(String.raw`\begin{circuitikz}\draw (0,0) to[L=$L$] (2,0);\end{circuitikz}`);

Without a bundler, from a CDN:

<script type="module">
  import { init, circuitikzToSvg } from "https://cdn.jsdelivr.net/npm/@mathlabs/voltik/web/index.js";
  await init();
  document.body.innerHTML = circuitikzToSvg(String.raw`\begin{circuitikz}\draw (0,0) to[R] (2,0);\end{circuitikz}`);
</script>

API

| | | |---|---| | init(input?) | Loads the wasm. Needed once in browsers and bundlers; does nothing in Node. input overrides where the wasm comes from (a URL, a Response, bytes or a WebAssembly.Module). | | circuitikzToSvg(code, options?) | The SVG as a string. options.locale ("en" by default, or "pt-BR", "es", "fr", "de", "it", "ru", "zh", "ja", "ko", "hi", "ar", "id", "tr", "nl", "pl") is the language of the figure in words; the drawing is the same in all. | | render(code, options?) | { svg, alt, description, warnings }: alt is the figure in one sentence (the SVG's <title>), description the figure in words (the SVG's <desc>), and warnings lists, as strings, what was ignored or approximated. The words are written by tikra from what it drew: review them before publishing. | | png(svg, options?) | PNG bytes as a Uint8Array. Options: dpi (300 by default) and background (true, white, by default; false for transparent). | | version() | The version of voltik's core inside the package (the npm package has its own version). |

code is a circuitikz environment, a tikzpicture that uses CircuiTikZ components, a full standalone document or loose statements. Errors (no figure in the input, an invalid dpi, a PNG past 100 megapixels) are thrown as Error.

Warnings, not errors

What voltik does not draw yet becomes a warning, and the rest of the circuit is drawn: a component it does not know (a source, a diode), an option it does not read.

Also for Python, Rust and the terminal

The same core is a Python module, a Rust crate and a command-line tool, and every one gives the same SVG, byte for byte. How to install each: github.com/matheusmota-dev-br/voltik.

License

The code is MIT or Apache-2.0; the fonts embedded through mathra are Latin Modern Math, under the GUST Font License, and STIX Two Math, under the SIL Open Font License 1.1.