@icona/generator
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

@icona/generator

Icona asset generator

Install

yarn add -D @icona/generator

Usage

import { generate } from "@icona/generator";

generate({
  config: {
    svg: {
      active: true, // you can disable svg generator if you set false
      path: "svg", // will generate svg files in svg folder
      svgoConfig: {},
    },
    drawable: {
      active: true, // you can disable drawable generator if you set false
      path: "drawable", // will generate xml files in drawable folder
      svg2vectordrawableConfig: {},
      defaultColor: "#000000", // default color for android vector drawable
    },
    pdf: {
      active: true, // you can disable pdf generator if you set false
      path: "pdf", // will generate pdf files in pdf folder
      pdfKitConfig: {},
      svgToPdfOptions: {},
    },
    react: {
      active: true, // you can disable react generator if you set false
      path: "react", // will generate react component files in react folder
      svgrConfig: {},
    },
    png: {
      active: false,
      genMode: "recreate",
      path: "png",
    },
    font: {
      genMode: "recreate",
      active: true,
      svgToFontOptions: {
        src: "svg",
        dist: "font",
        fontName: "seed-icon",
      },
    },
    flutter: {
      active: true,
      ttfPath: "font/seed-icon.ttf",
      fileName: "SeedIcons",
      fontFamily: "SeedIcon",
      genMode: "recreate",
      path: "flutter",
    },
  },
});

@icona/generator use several libraries to generate assets.

you configure each library options in config object. If you want to see real example, you can see here (seed-icon)

Readme

Keywords

none

Package Sidebar

Install

npm i @icona/generator

Weekly Downloads

9

Version

0.6.0

License

none

Unpacked Size

107 kB

Total Files

24

Last publish

Collaborators

  • junghyeonsu