icon-magic

2.1.0-beta.0 • Public • Published

icon-magic

This package is just a pass through to the Icon Magic CLI

Install

Using npm:

npm install --save-dev icon-magic

or using yarn:

yarn add icon-magic --dev

Usage

Usage:
  icon-magic [command] <directories ...> [options]

Commands:
  build               Construct flavors that an icon from its variants, after applying the build plugins. No options available.
  generate            Generates the flavors of the icon in the extension types that it can be consumed.
  distribute          Moves an icon from the source to the destination, applying plugins if specified.

Options:
  -h, --help              Display usage
  -v, --version           Display version

Commands

If no command is specified after icon-magic, the CLI runs build and generate on the directories specified.

icon-magic .
icon-magic icons/

build and generate automatically write to the out folder in whatever directory they're run in.

Build

icon-magic build .
icon-magic build icons/

Given a set of input directories, finds the closest config file (iconrc.json/iconrc.js/icon) and "builds" the icons from it. Refer to @icon-magic/build for more details.

Generate

icon-magic generate .
icon-magic generate icons/

Given a directory of icons (each icon containing it's own config file consisting of all the flavors from the build step), the generate step is responsible for going through the config file to determine the platforms on which the icon needs to be supported. Refer @icon-magic/generate for more details.

Distribute

Organizes and structures the files from the generate step how they need to be consumed, creates the necessary files for platform consumption and moves the icons from an input folder to the output folder. The input folder for the distribute command should be the output folder of build and generate

The distribute command is the only command for now that requires an output path (as an option -o or --outputPath). As well as the only command with options. Run icon-magic distribute --h for options.

icon-magic distribute inputPath --outputPath

Options: -o, --outputPath Path to the output directory where the generated assets are to be written to -t, --type type of icons format to handle, accepted types are svg|png|webp -g, --groupBy [currently the only supported use is for web sprite creation] if to how to group the icons by category

Refer @icon-magic/distribute for more details.

Readme

Keywords

none

Package Sidebar

Install

npm i icon-magic

Weekly Downloads

11

Version

2.1.0-beta.0

License

BSD-2-Clause

Unpacked Size

3.11 kB

Total Files

5

Last publish

Collaborators

  • chrisheninger
  • epicmiller