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

@archlex/icons-core

v0.2.6

Published

Core icon utilities for ArchLex architecture diagrams

Readme

@archlex/icons-core

Core icon utilities for ArchLex architecture diagrams.

Installation

npm install @archlex/icons-core

Usage

import { IconRegistry, parseIconSvg, optimizeIcon } from '@archlex/icons-core';

// Create an icon registry
const registry = new IconRegistry();

// Register an icon
registry.register('my-service', {
  id: 'my-service',
  name: 'My Service',
  svg: '<svg>...</svg>',
  category: 'custom'
});

// Get an icon
const icon = registry.get('my-service');

// Parse and optimize SVG
const parsed = parseIconSvg('<svg width="100" height="100">...</svg>');
const optimized = optimizeIcon(parsed);

Features

  • SVG parsing and manipulation
  • Icon optimization and normalization
  • Registry pattern for icon management
  • Type-safe icon definitions
  • Supports both Node.js and browser environments

Icon Definition

interface IconDefinition {
  id: string;
  name: string;
  svg: string;
  category?: string;
  tags?: string[];
  viewBox?: string;
}

Icon Registry

const registry = new IconRegistry();

// Register multiple icons
registry.registerMany([
  { id: 'icon1', name: 'Icon 1', svg: '...' },
  { id: 'icon2', name: 'Icon 2', svg: '...' }
]);

// Check if icon exists
if (registry.has('icon1')) {
  const icon = registry.get('icon1');
}

// List all icons
const allIcons = registry.list();

// Search icons
const computeIcons = registry.search('compute');

SVG Utilities

import { parseIconSvg, optimizeIcon, embedIcon } from '@archlex/icons-core';

// Parse SVG string
const parsed = parseIconSvg(svgString);

// Optimize SVG (remove unnecessary attributes, minify)
const optimized = optimizeIcon(parsed);

// Embed as data URI
const dataUri = embedIcon(optimized);

Documentation

Visit archlex.dev for full documentation.

License

MIT

SVG winding rules

sanitizeSvg preserves fill-rule and clip-rule so compound shapes retain cutouts and clipping geometry. Supported values are nonzero, evenodd, and inherit, including presentation styles. Invalid values are rejected; external references and active SVG content remain forbidden.

Stroke joins retain stroke-miterlimit when it is a finite SVG number of at least 1, or inherit. Invalid values are rejected during sanitization.