0.0.1 • Published 22 days ago

@nfq/adition-switch v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

@nfq/svg-to-react

EsLint


  1. Description
  2. Getting started
    1. Installation
  3. Usage
  4. Props
  5. Support

Description: License: MIT

This project, @nfq/svg-to-react, is a powerful tool that allows you to convert SVG images into React components. It's built with Node.js and TypeScript. The main functionality of this package is to take a directory or a file of SVG images as input, and output a directory of React components. This is particularly useful for projects where SVG images are used extensively and need to be managed efficiently. The package provides a command line interface for easy use. It also supports different templates for generation, including 'typescript', 'jsdoc-typescript', and 'legacy'. This allows you to choose the format that best suits your project's needs.


Getting started

To the package follow the next steps:

Installation

To install the package run

npm install -g <Project name>

if you are on yarn

yarn add --global <Project name>

or on pnpm

pnpm install -g <Project name>

Usage

You can use this package to convert SVG files to React components. You can specify the input directory or file, the output directory, and the template to use for generation. The available templates are 'typescript', 'jsdoc-typescript', and 'legacy'.

For example, to convert all SVG files in the icons directory and output them as TypeScript React components in the components directory, you would use the following command:

svgToReact --src ./icons --out ./components --template typescript

Props

This package provides a command line interface with the following options:


Support

Christoph Kruppe - https://github.com/ckruppe - c.kruppe@nfq.de