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

@ixiaer/icon

v1.1.6

Published

Responsive website icon solution. Integration svg-sprite and webfonts-generator simple Node API and CLI. Support multi-color(symbol) and single color(font) icons.

Downloads

7

Readme

JavaScript Style Guide Conventional Commits

📦 Installation

To install @ixiaer/icon

npm install @ixiaer/icon

💡 Getting started

Responsive website icon simple Node API and CLI solution. Support multi-color(symbol icon) and single color(font icon) icons.

  1. Register a couple of SVG source files for processing.
  2. Trigger the compilation process and receive the generated files(SVG, JS, Fonts, CSS).

💻 CLI Generator

# help
$ icon --help

Usage: icon [font|symbol] [options] [arguments]
       icon -i "icons/*.svg" --css-dest styles/

Must:
  -i, --icons     $ icon -i "icons/*.svg"

Options:
  -n, --name      $ icon -n ixiaer
  -t, --template  $ icon -t template/icon-font.css

Font options:
  --font-dest  $ icon --font-dest fonts/
  --css-dest   $ icon --css-dest styles/
  --font-type  $ icon --font-type "svg,ttf,woff,woff2,eot"
  --css-type   $ icon --css-type "css,scss,less,stylus"

Symbol options:
  --js-dest   $ icon --js-dest scripts/

Alias: ixiaer-icon > icon

Templates

🧩 Node API

/**
  * Must:
  * @param {string} opt.icons - List of SVG files.
  *
  * Options:
  * @param {string} opt.name - Name of font and base name of font files.
  * @param {string} opt.template - Path of custom CSS template. Generator uses handlebars templates.
  *
  * Font options:
  * @param {string} opt.fontDest - Directory for generated font files.
  * @param {string} opt.cssDest - Path for generated CSS file.
  * @param {Array} opt.fontType - Font file types to generate. Possible values: ['svg', 'ttf', 'woff', 'woff2', 'eot'].
  * @param {Array} opt.cssType - Css file types to generate. Possible values: ['css', 'scss', 'less', 'stylus'].
  *
  * Symbol options:
  * @param {string} opt.jsDest - JavaScript output destination.
  */

const iconFont require('@ixiaer/icon/lib/icon-font.js')
const iconSymbol require('@ixiaer/icon/lib/icon-symbol.js')

iconFont({
  name: 'ixiaer',
  icons: 'icons/*.svg',
  template: 'templates/icon-font.css',
  fontDest: 'assets/fonts',
  cssDest: 'assets/styles',
  fontType: ['svg', 'ttf', 'eot', 'woff', 'woff2'],
  cssType: ['css', 'scss', 'less', 'stylus']
})

iconSymbol({
  name: 'ixiaer',
  icons: 'icons/*.svg',
  template: 'templates/icon-symbol.js',
  jsDest: 'assets/scripts'
})

Templates

💛 Font Icon Usage

// Webpack
import 'assets/styles/ixiaer.css'
<!-- CDN -->
<link href="assets/styles/ixiaer.css" rel="stylesheet" type="text/css" />
<!-- Use icons -->
<i class="ixiaer-foo"></i>
<i class="ixiaer-bar"></i>

Click try it!

💝 Symbol Icon Usage

// Webpack
import 'assets/scripts/ixiaer.js'
<!-- Or Browser -->
<script type="text/javascript" src="assets/scripts/ixiaer.js"></script>
<!-- Use icons -->
<svg class="ixiaer" aria-hidden="true">
  <use xlink:href="#ixiaer-foo" />
</svg>
<svg class="ixiaer" aria-hidden="true">
  <use xlink:href="#ixiaer-bar" />
</svg>

Click try it!

🔗 Compatibility

Font Icon: Support for IE8+, and modern browsers Symbol Icon: Support for IE9+, and modern browsers

If you like this project, please reward a star. Thank you 🙏