2.2.1 • Published 2 years ago

@tadashi/spritetify v2.2.1

Weekly downloads
35
License
MIT
Repository
-
Last release
2 years ago

spritetify

NPM version Node.js CI XO code style


Generate SVG sprite

Install

$ npm i -S @tadashi/spritetify

Usage

CLI

Usage: spritetify [options]

Generate SVG sprite

Options:
  -V, --version            output the version number
  -d, --inputDir <dir>     directory with the SVG files
  -o, --outputFile <file>  name with path of output file
  -c, --configFile [json]  plugin options
  -h, --help               display help for command

Samples

$ npx spritetify -d dir/with/svg/files > ./sprite.svg
$ npx spritetify -d dir/with/svg/files -o dir/of/sprite/file.svg -c

API

import spritetify from '@tadashi/spritetify'

const data = await spritetify('dir/with/svg/files')
// => <svg width="0" height="0" display="none" version="1.1...

spritetify(inputDir [, outputFile] [, options]):String

parametertyperequireddefaultdescription
inputDirStringyes-directory with the SVG files
outputFileStringno-name with path of output file
optionsObjectnosee belowplugin options

⚠️ Attention

If outputFile is not set, the return will be the sprite's string.

options
parametertyperequireddefaultdescription
idStringno%sTemplate for Symbol ID
...rest-no-SVGO Options

The remaining options are the same of SVGO

Options

spritetify.config.json

{
  "id": "my_app_%s",
  "plugins": [
    "removeTitle"
  ]
}

License

MIT © Thiago Lagden

2.2.1

2 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

4 years ago