UNPKG

2.17 kBMarkdownView Raw
1# @svgr/cli
2
3[![Build Status][build-badge]][build]
4[![version][version-badge]][package]
5[![MIT License][license-badge]][license]
6
7Command Line Interface for SVGR.
8
9```
10npm install @svgr/cli
11```
12
13## Usage
14
15```
16Usage: svgr [options] <file|directory>
17
18Options:
19
20 -V, --version output the version number
21 --config-file <file> specify the path of the svgr config
22 --no-runtime-config disable runtime config (".svgrrc", ".svgo.yml", ".prettierrc")
23 -d, --out-dir <dirname> output files into a directory
24 --ext <ext> specify a custom file extension (default: "js")
25 --filename-case <case> specify filename case ("pascal", "kebab", "camel") (default: "pascal")
26 --icon use "1em" as width and height
27 --native add react-native support with react-native-svg
28 --ref forward ref to SVG root element
29 --no-dimensions remove width and height from root SVG tag
30 --expand-props [position] disable props expanding ("start", "end", "none") (default: "end")
31 --svg-props <property=value> add props to the svg element
32 --replace-attr-values <old=new> replace an attribute value
33 --template <file> specify a custom template to use
34 --title-prop create a title element linked with props
35 --prettier-config <fileOrJson> Prettier config
36 --no-prettier disable Prettier
37 --svgo-config <fileOrJson> SVGO config
38 --no-svgo disable SVGO
39 -h, --help output usage information
40
41 Examples:
42 svgr --replace-attr-values "#fff=currentColor" icon.svg
43```
44
45## License
46
47MIT
48
49[build-badge]: https://img.shields.io/travis/smooth-code/svgr.svg?style=flat-square
50[build]: https://travis-ci.org/smooth-code/svgr
51[version-badge]: https://img.shields.io/npm/v/@svgr/core.svg?style=flat-square
52[package]: https://www.npmjs.com/package/@svgr/core
53[license-badge]: https://img.shields.io/npm/l/@svgr/core.svg?style=flat-square
54[license]: https://github.com/smooth-code/svgr/blob/master/LICENSE