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

svg-stacker

v0.0.2

Published

An experimental tool that turns a folder of SVG files into a single SVG Stack

Downloads

8

Readme

SVG Stacker

An experimental tool that turns a folder of SVG files into a single SVG Stack. It also creates some demo HTML files that use the stack with different embedding-techniques (iframe, embed, img, object, background-image).

SVG Stacker is based on NODE.js.

The project contains three example stacks based icons of the famous Tango Icon Library, the popular Iconic icon set by P.J. Onori and files from wikipedia.

I created SVG Stacker to explore the power of the SVG Stack concept and test filesize, performance and browser-support.

Example Stacks

with Webkit fix:

About SVG Stacks

Simon 'Simurai' first described 'SVG Stacks' in March 2012. It's a technique to stack different SVG objects into one file to save HTTP Requests.

First we give each of our icons in the SVG file a unique ID and the same class name, add some CSS to hide all icons and only display the one that gets selected with :target. And now we can use a hash in the URL to pass the ID into the SVG file, like background: url(icon.svg#ID).

Read Simons blog post. Simon also created a SVG Stack demo that works pretty well in Firefox, but not yet in Webkit, see (Webkit-Bug).

The ':target'-technique was first introduced by @erikdahlstrom – it's worth checking out his SVG Code snippets.

Wekit Fix

Read annotated source.

Background

We decided to work with SVG for a recent mobile website project. It is an open standard, it is widly supported by browsers and leads to great visual results, especially when it comes to devices with different pixel densities.

"SVG-Stacks are the new Imagesprites." – Are they?

There are pros and cons. Here is a list of things we thought about so far and would like to discuss:

  1. Support for colors

    compared to monocromatic icons, that can be easily embedded with Webfonts

  2. Easier to write and read in CSS

    button.cart {
      background: transparent url(stack.svg#cart) no-repeat top left;
    }

    compared to

    [data-icon]:before {
        font-family: 'IcoMoon';
        content: attr(data-icon);
    }
    <a href="#" class="button-with-icon" data-icon="+">Add</a>

    Webfont icon embed

    Webfonts are great for monochrome icons. Icomoon is a great tool to define icon sets and add custom svg objects. One could argue that they causes some semantic issues as they always produce content (compared to decorative background-image), which might be OK when using Unicodes Private Use Area.

    But for Developers it might feel more natural to work with SVG Stacks as

  3. SVG Stacks behave like raster-images

    <img src="stack.svg#flowers">

    They can be treat in HTML and CSS like we used to treat raster images.

  4. Animation

    See soccer-ball in Wikipedia Example

  5. (Not) yet available on Webkit

    There is a Webkit-Bug that needs to be fixed to make SVG Stacks work.

    Update For now I created a jQuery Plugin to fix SVG Stacks for Webkit. See Webkit Fix above.

  6. Slow?

    Test the examples: Some browser need an extensive rendering time.