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

@rasir/symbol-iconfont

v1.1.2

Published

将svg生成symbol模式iconfont

Downloads

9

Readme

@rasir/symbol-iconfont

Introduction

Automatically converts SVG files into ionfont.js and outputs a React Icon component, which is not compatible with IE. Usage npm i @rasir/symbol-iconfont -g

API

   --id <id>             Parent element ID, defaults to the same as the file name to prevent creating duplicate parent elements for the same iconfont file.

   -c,--clazz            Output React class component, defaults to outputting a React functional component.

   -d,--deep             Whether to recursively traverse directories.

   -p,--pure             Whether to remove colors.

    -r                    Indicates whether to restore all svgs.  --pick/--remove/--add are deactivated.

   --restore <restore>    Only restore specified svg files without modifying the original iconfont.js file. The names of the symbols to be restored are indicated, separated by commas.When --restore has a value, --pick/--remove/--add are deactivated.



   --add <add>            Add svg to the iconfont file specified by output. Directories where the svg to be added are located should be specified. If there are duplicate named svgs, numbers will be added in their names.

   --remove <remove>      Specify symbols to remove from the iconfont file. Names of the symbols to be removed should be indicated and separated by commas.

   --pick <pick>           Specify symbols in the iconfont file that need restoration into svg files and also removal from files. Names of these symbols should also be indicated and separated by commas.

   --html                Generate template HTML according to the specified iconfont.js

   -i,--input <input>    Input path, default is the current directory.

   -o,--output <output>  Output path, default is /dist.

   -h,--help             API description.

   -v,--version          Version information.

Usage example

bsicon --id=bdpicon -d -p -i=/asserts -o=/dist

Output results

dist
    Icon
        index.tsx --- React component TSX file
        index.less --- React component stylesheet LESS file
    iconfont.js --- Icon font file containing all SVG information
    index.html --- Icon font example that allows you to click the icon to copy the type

1.0.3

If you want to remove colors from some SVGs and keep colors from others, you can create a new "pure" directory within the directory specified by -i, place the SVGs you want to remove colors into it, and do not use -p in the command line but add -d instead.
If -p is added to the command line, the output will have all colors removed.
If -d is not added to the command line, the program will not read the "pure" directory.
e.g: --id=bdpicon -d -i=/asserts -o=/dist

1.1.1

  1. Restore SVG Convert iconfont.js back to svg files bsion -r -i=/asserts/iconfont.js -o=/dist You can also specify the name of the svg to be restored bsion -i=/asserts/iconfont.js -o=/dist --restore=a,b,c Restoring SVG will not modify the original iconfont.js nor will it generate a new iconfont.js

  2. Add svg to iconfont.js bsion -i=/asserts/iconfont.js -o=/dist --add=/dir bsion -i=/asserts/iconfont.js -o=/dist --add=/dir/new.svg

  3. Remove specific svg from iconfont.js bsion -i=/asserts/iconfont.js -o=/dist --remove=a,b,c

  4. Retrieve specific svg from iconfont.js bsion -i=/asserts/iconfont.js -o=/dist --pick=a,b,c

  5. Generate html template based on iconfont.js bsion -i=/asserts/iconfont.js -o=/dist --html