UNPKG

2.75 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 --save-dev
11```
12
13## Usage
14
15```
16Usage: svgr [options] <file|directory>
17
18Options:
19 -V, --version output the version number
20 --config-file <file> specify the path of the svgr config
21 --no-runtime-config disable runtime config (".svgrrc", ".svgo.yml", ".prettierrc")
22 -d, --out-dir <dirname> output files into a directory
23 --ignore-existing ignore existing files when used with --out-dir
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 --memo add React.memo into the result component
29 --ref forward ref to SVG root element
30 --no-dimensions remove width and height from root SVG tag
31 --expand-props [position] disable props expanding ("start", "end", "none") (default: "end")
32 --svg-props <property=value> add props to the svg element
33 --replace-attr-values <old=new> replace an attribute value
34 --template <file> specify a custom template to use
35 --index-template <file> specify a custom index.js template to use
36 --no-index disable index file generation
37 --title-prop create a title element linked with props
38 --desc-prop create a desc element linked with props
39 --prettier-config <fileOrJson> Prettier config
40 --no-prettier disable Prettier
41 --svgo-config <fileOrJson> SVGO config
42 --no-svgo disable SVGO
43 --silent suppress output
44 --stdin force reading input from stdin
45 --stdin-filepath path to the file to pretend that stdin comesfrom
46 -h, --help output usage information
47
48 Examples:
49 svgr --replace-attr-values "#fff=currentColor" icon.svg
50```
51
52## License
53
54MIT
55
56[build-badge]: https://img.shields.io/travis/smooth-code/svgr.svg?style=flat-square
57[build]: https://travis-ci.org/smooth-code/svgr
58[version-badge]: https://img.shields.io/npm/v/@svgr/core.svg?style=flat-square
59[package]: https://www.npmjs.com/package/@svgr/core
60[license-badge]: https://img.shields.io/npm/l/@svgr/core.svg?style=flat-square
61[license]: https://github.com/smooth-code/svgr/blob/master/LICENSE