# svgson-loader

> Converts svg+xml files to JSON. Based on [svgson](https://www.npmjs.com/package/svgson) npm package. Can be used for rendering SVG via React components.

Latest version **2.0.0** (published 2017-12-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install svgson-loader
pnpm add svgson-loader
yarn add svgson-loader
bun add svgson-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-12-27 |
| First published | 2017-09-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | artur.udalov |

## Links

- npm: https://www.npmjs.com/package/svgson-loader
- Repository: https://github.com/darkartur/svgson-loader
- Homepage: https://github.com/darkartur/svgson-loader#readme
- Issues: https://github.com/darkartur/svgson-loader/issues
- npm.io page: https://npm.io/package/svgson-loader

## Dependencies (1)

- [svgson](https://npm.io/package/svgson.md) ^2.1.0

## Recent versions

- 2.0.0 (latest) — 2017-12-27
- 1.1.2 — 2017-09-28
- 1.1.1 — 2017-09-28
- 1.1.0 — 2017-09-18
- 1.0.0 — 2017-09-15

## README

# SVGSON webpack loader

Converts svg+xml files to JSON. Based on [svgson](https://www.npmjs.com/package/svgson) npm package.
Can be used for rendering SVG via React components.

## Installation

```
npm install svgson-loader --save-dev
```

## Why not [svg-react-loader](https://github.com/jhamlet/svg-react-loader)?

We are writing React UI library with icon button which filling it's background color 
based on [SVG 1.2](https://www.w3.org/TR/SVG12/) property "viewport-fill":


```
import vkIcon from 'svgson-loader!./icons/vk.svg';
import okIcon from 'svgson-loader!./icons/ok.svg';
import fbIcon from 'svgson-loader!./icons/fb.svg';

stories.add('Social buttons', () => (
	<div>
		<Button icon={vkIcon} />
		<Button icon={okIcon} />
		<Button icon={fbIcon} />
	</div>
));
```
So `Button` reads "viewport-fill" attribute inside JSON, applies backgroundColor property
then generates React.createElement calls to render SVG.

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