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

@jts-studios/icons

v0.4.0

Published

Framework-agnostic SVG icon web component from JTS Studios.

Readme

@jts-studios/icons

npm license

Framework-agnostic SVG icon web component from JTS Studios.
All icons are compiled into an inline SVG sprite at build time — zero HTTP requests, instant rendering.


Installation

npm install @jts-studios/icons

Usage

Import once anywhere in your app entry point:

import "@jts-studios/icons"

Then use <jts-icon> anywhere in your HTML:

<jts-icon icon="chevron-down"></jts-icon>

No CSS import required — styles are injected automatically.

Styling

Control size and color via CSS:

jts-icon {
    width: 24px;
    color: currentColor; /* stroke or fill color */
}

Use stroke mode by default, or set the filled attribute for filled icons:

<jts-icon icon="moon"></jts-icon>
<jts-icon icon="moon" filled></jts-icon>

Available Icons

| Name | Usage | |---|---| | book-open | <jts-icon icon="book-open"> | | chevron-down | <jts-icon icon="chevron-down"> | | chevron-left | <jts-icon icon="chevron-left"> | | chevron-right | <jts-icon icon="chevron-right"> | | chevron-up | <jts-icon icon="chevron-up"> | | copy | <jts-icon icon="copy"> | | moon | <jts-icon icon="moon"> | | sun | <jts-icon icon="sun"> |

Adding Icons

Drop any .svg file into src/icons/ and run npm run build. The icon is automatically picked up by the sprite compiler — no registration needed.

Scripts

| Command | Description | |---|---| | npm run build | Build the library | | npm run clean | Remove dist/ | | npm run release | Bump patch version and publish | | npm run release:minor | Bump minor version and publish | | npm run release:major | Bump major version and publish |

How It Works

  1. At build time, all .svg files in src/icons/ are compiled into a single <svg><defs><symbol>… sprite string and bundled into the JS output. Each SVG is passed through SVGO (path compression, shape normalisation, numeric cleanup) before being written to the sprite.
  2. Shared presentation attributes (fill, stroke, stroke-linecap, stroke-linejoin, stroke-width) are moved to CSS rather than repeated on every symbol, shrinking the sprite by ~70–80 bytes per icon.
  3. On first use, the sprite is injected once into document.body via DOMParser — preserving SVG namespaces without a throwaway wrapper element.
  4. Styles are injected via the Constructable StyleSheets API (CSSStyleSheet.replaceSync + document.adoptedStyleSheets) where supported, falling back to a <style> tag. This avoids HTML parsing overhead and lets the stylesheet be shared across shadow roots.
  5. Each <jts-icon> element builds its <svg><use> structure once with createElementNS (no innerHTML). Subsequent icon changes patch only the href attribute — no DOM nodes are recreated.
  6. CSS contain: layout style isolates each icon's layout and style recalculations from the rest of the page.

Performance vs Lucide Icons

| Metric | Lucide | @jts-studios/icons | |---|---|---| | DOM nodes per icon | Full SVG tree per usage | 1 <use> reference — paths live once in sprite | | Same icon × 10 | 10× full SVG trees in DOM | 10× <use> — zero extra path nodes | | Re-render cost | Recreates full SVG DOM | Patches a single href attribute | | Style injection | Inline attributes on every element | One Constructable StyleSheet shared by all | | Sprite injection | N/A | DOMParser — no throwaway element | | Path data | Raw SVG source | SVGO-compressed at build time | | Layout isolation | None | contain: layout style per icon |


© 2026 JTS Studios. All Rights Reserved.