@psoares/svg-list

1.2.1 • Public • Published

svg-list

Generates a JSON or Javascript list with optimised SVGs

NPM JavaScript Style Guide

Description

This small script is useful to maintain your project icons updated and optimised without having the painful work of everytime you change an svg icon file you need to go through SVG optimizer, clean the code and then just add it to you custom js or json files.

Install

yarn add @psoares/svg-list

Usage

  • Create your setup file in the root of your project with the name .svglistrc.json
{
    "passAllAttributes": true, // optional: this will ensure all attrs from each pass will be passed to the generated file
    "src": "icons", // source directory with multiple directories
    "dest": "src/components/icons", // target directory for js / json fiiles
    "format": "js", // optional: `js` (default) or `json`
}
  • To generate your files run
yarn svglist generate

To do:

  • To preview your generated files run
yarn svglist preview

This will fireup a simple react app that runs in port 8004 with a preview of all the svgs that you have generated.

Note: this will not generate the svg files for you, so you need to run generate first

License

MIT © psoaresbj

Dependents (0)

Package Sidebar

Install

npm i @psoares/svg-list

Weekly Downloads

342

Version

1.2.1

License

MIT

Unpacked Size

8.42 kB

Total Files

7

Last publish

Collaborators

  • psoares