# svg-fab

> Convert a Sketch SVG into one suitable for import into a Sprite component

Latest version **0.6.0** (published 2022-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install svg-fab
pnpm add svg-fab
yarn add svg-fab
bun add svg-fab
```

Provides the command `svg-fab`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2022-10-08 |
| First published | 2019-09-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 5 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 (+16 in 1 direct dependencies) |
| Install scripts | no |
| Author | ayan4m1 |
| Maintainers | ayan4m1 |
| Keywords | cli, sketch, svg, outline, convert, image, sprite |

## Links

- npm: https://www.npmjs.com/package/svg-fab
- npm.io page: https://npm.io/package/svg-fab

## Dependencies (5)

- [svgo](https://npm.io/package/svgo.md) ^2.8.0
- [xpath](https://npm.io/package/xpath.md) ^0.0.32
- [xmldom](https://npm.io/package/xmldom.md) ^0.6.0
- [slugify](https://npm.io/package/slugify.md) ^1.6.5
- [commander](https://npm.io/package/commander.md) ^9.4.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.6.0 (latest) — 2022-10-08
- 0.5.1 — 2022-05-02
- 0.5.0 — 2022-03-01
- 0.4.0 — 2022-01-02
- 0.3.0 — 2021-08-27
- 0.2.1 — 2019-09-05

## README

# svg-fab

This utility will convert a Sketch-exported SVG into a `<symbol>` element suitable for use as an icon.

## Usage

The source SVG must be composed of a single path - use the "Layer > Convert to Outlines" command in Sketch.

Once you have your SVG, install the utility:

```sh
npm install -g svg-fab
```

Then, specify a name for the symbol and the path to the SVG like so:

```sh
svg-fab -n expand my-expand-icon.svg
```

The utility prints its output to stdout. You can copy and paste the `<symbol>` element it generates into your sprite sheet.

The name argument is automatically [slugified](https://github.com/simov/slugify) - wrap it in double quotes if it contains spaces. For example:

```sh
svg-fab -n "my extremely long, convoluted, and entirely unfriendly icon name" my-icon.svg
```

In this example the exported `<symbol>` will have an `id` attribute of `icon-my-extremely-long-convoluted-and-entirely-unfriendly-icon-name`.

---
_Source: https://npm.io/package/svg-fab · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
