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

create-chakra-icons

v1.3.0

Published

<p align="center"> <label style="font-weight:bold;font-size:200%">Transform SVG to React Chakra UI <Icon \/> ✨ </label> <br/><label style="font-weight:bold;font-size:small;font-style:italic">from SVG file to CODE</label> <br/> <br/> <img src="ht

Downloads

4,703

Readme

Features

  • [x] Transform <SVG/> to Chakra-UI Icon Component or Functional createIcon(...).
    • <Icon /> Component, See.
    • createIcon(...) Functional, See.
  • [x] Multiple input with directories or files as input value for option -i or --input.
  • [x] Support case in export name declaration (camel|snake|pascal|constant).
  • [x] Suffix and Prefix for generated code of export name declaration.
  • [x] Support type annotation when code generated is <Icon />.

Usage

Command Line Arguments

create-chakra-icons [FLAGS] [OPTIONS] [INPUT]

Flags

-h, --help      Prints help information
-V, --version   Prints version information

Options

-i, --input <PATH>      This option for read the input from PATH of FILE or DIRECTORIES.
                        [e.g.: -i some/path , -i file.svg]
-o, --output <PATH>     Writes the output. [default: stdout]
-n, --name <STRING>     Sets value for `displayName` properties
                        (*ONLY for pipelines command). [default: Unamed] [e.g. -n "MyIcon"]
-C, --case <snake|camel|constant|pascal>
                        Sets for case [snake|camel|constant|pascal] in export named declaration
                        output. [default: pascal]
-S, --suffix <STRING>   Sets for suffix in export named declaration.
-P, --prefix <STRING>   Sets for prefix in export named declaration.
                        [e.g.: -S "Icon"]
--ts, --typescript      Sets output as TypeScript code.

-T, --type <TYPE>       TYPE:
                        (F|f). Sets output code with function \`createIcon({...})\`.
                        (C|c). Sets output code with Component Icon \`(props) => <Icon> {...} </Icon>\`.

                        [e.g.: -T C]

Input

[INPUT]     This option for read the input from PATH of FILE or DIRECTORIES.
            [e.g.: create-chakra-icons ./MyICON.svg ~/assets]

Examples

Pipelines command:

  • input in pipe
echo "
<svg viewBox=\"0 0 200 200\">
    <path
      fill=\"#666\"
      d=\"M 100, 100 m -75, 0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0\"
    />
  </svg>
" | create-chakra-icons -n "KodingNinjaIcon"
  • output in stdout
import { createIcon } from "@chakra-ui/react";
export const KodingNinjaIcon = createIcon({
  displayName: "KodingNinjaIcon",
  viewBox: "0 0 200 200",
  d: "M 100, 100 m -75, 0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0",
});

Multiple Input

  • input per-file
create-chakra-icons  -o Icons.js ./Facebook.svg ./Apple.svg ./Amazon.svg ./Netflix.svg ./Google.svg
  • input directories
create-chakra-icons  -o Icons.js ./social-icons
  • input directories and per-file at the same time
create-chakra-icons  -o Icons.js ./MyCompany.svg ./social-icons
  • output will be make in Icons.js (argument -o or --output).

Roadmap

  • [x] TypeScript Support (Type Annotation or Type Definition).
    • Only when code generated is <Icon /> component See.
  • [ ] ReScript Support.
  • [ ] Per file input is Per file output. ⁉️ 🤔
  • [ ] Feel free for give me any feedback or feature request (create an issue first).

Maintainer

Contribution

Feel free for making an issue, pull request, or give any feedback. 🙌

Documentation

  • Write the documentation 📝, you just need to modify comments in lib/*.js.
  • When you done write the documentation, you just need to run yarn docs in the root repository.
  • The command yarn docs will modify README.md and see the changes.

LICENSE

See Here