Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dervexdev/svg-to-tsx

Convert all your SVGs to a single TSX module
https://github.com/dervexdev/svg-to-tsx

cli icons jsx react svg tsx

Last synced: about 1 month ago
JSON representation

Convert all your SVGs to a single TSX module

Awesome Lists containing this project

README

        

# svg-to-tsx

Convert all your SVGs to a single TSX module


Version badge
Downloads badge
License badge

## Usage

1. Run `npm i svg-to-tsx`
2. Add following script to your `package.json`

```json
"icons": "svg-to-tsx -i ./input/path -o ./output/path -n fileName"
```

3. Run `npm run icons`

## CLI Options

| Short | Long | Description | Default |
| ----- | -------- | ----------------------------------- | ------- |
| -i | --input | Path to where SVG files are located | none |
| -o | --output | Output module destination path | none |
| -n | --name | Output module file name | "icons" |

## Warning

This package was made in a hurry because I needed it for my website. I will improve it somewhere in the future with additional settings.