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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@icon-magic/icon-models

v2.8.0-beta.0

Published

Icon magic provides classes for the icon and iconSet

Downloads

7

Readme

@icon-magic/icon-models

This is the core of @icon-magic as it contains all the classes for that represent the icon and a set of icons.

  • defining the Icon and IconSet interfaces
  • exposing a class that manipulates the icon in memory
  • provides plugin-manager functions that apply plugins on the icon
  • provides utils for writing the icon and it's config to disk

Interface

Asset

Abstracts the smallest set of information that pertains to an asset file in memory. Primary, it's path, name and contents, if it's already read into memory

Flavor

In it's simplist definition, a Flavor is an Asset with types. This class contains Assets for all the different types in which it can exist For example, a Flavor consists of it's source svg as well as paths to it's png and webp assets

Icon

Encapsulates what an Icon means. An Icon is referenced by a path to it's directory and this directory can be assumed to contain all the different variants and flavors in which the icon is available, in all of it's different types(extensions). The config itself is generally more concise and human readable but this class supplements it by providing methods on it and filling in the gaps where they don't exist

Icon Set

Encapsulates a set of icons and consists of a mapping of the directory to the icon bundle and the Icon class associated with that icon

Plugin-runner

Plugin runner is responsible for consecutively iterating through different properties of the config file, such as variants/flavors and applying the list of plugins on each variant/flavor If a plugin has more than one prop, then it results in multiple files, one for each combinations of props. Else, one input file will result in one output file. eg: P1 has [T1, T2] and runs on A.svg => A-T1.svg and A-T2.svg P2 has one theme - [theme1], then the result will still be A-T1.svg and A-T2.svg the hyphenated theme name gets added only if there is more than one theme for a plugin