Exporting icons
Iconify Tools can export icons to several formats.
Usage
All functions listed below work with IconSet instances. You need to create instance using blankIconSet() or by using one of import functions.
Cleanup and optimisation
Before exporting icons, make sure you clean them up and optimise.
See icon manipulation functions.
Export functions
There are several functions for exporting icons:
Exporting Iconify icon set
IconSet instance has export() function that creates IconifyJSON data. All you have to do is write it to file.
See exporting Iconify icon set documentation.
Exporting SVG (simplified version)
Function exportToDirectory() exports all icons as SVG to a directory.
Exporting as SVG
IconSet instance has toString() function that generates string for icon. You can use forEach() to loop all icons in icon set.
See exporting icons as SVG documentation.
Exporting NPM packages
There are different types of icon packages published at NPM, there are functions for exporting each type:
- Function exportIconPackage() creates NPM package with one file per icon. This is used when a user needs only a few icons. This method is deprecated, but function is still maintained because some developers use it.
- Function exportJSONPackage() creates NPM package with an entire icon set in one file. This is used to get an entire icon set.
Functions do not publish packages, they only generate contents. Run npm publish to publish generated packages.