# node-svg-inliner

> Node.js SVG inliner for web servers

Latest version **1.0.1** (published 2015-07-28) · GPL 2.0 license · 0 weekly downloads

## Install

```sh
npm install node-svg-inliner
pnpm add node-svg-inliner
yarn add node-svg-inliner
bun add node-svg-inliner
```

## 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 | 1.0.1 |
| Published | 2015-07-28 |
| First published | 2014-12-05 |
| Weekly downloads | 0 |
| License | GPL 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Erik Weilow |
| Maintainers | nissehutt |
| Keywords | node, svg, inliner, html, xml |

## Links

- npm: https://www.npmjs.com/package/node-svg-inliner
- Repository: https://github.com/eweilow/node-svg-inliner
- Issues: https://github.com/eweilow/node-svg-inliner/issues
- npm.io page: https://npm.io/package/node-svg-inliner

## Dependencies (1)

- [xml2js](https://npm.io/package/xml2js.md) ^0.4.9

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-07-28
- 1.0.0 — 2015-07-28
- 0.0.5 — 2014-12-07
- 0.0.4 — 2014-12-07
- 0.0.3 — 2014-12-05
- 0.0.2 — 2014-12-05
- 0.0.1 — 2014-12-05

## README

node-svg-inliner
================
[![Build Status](https://travis-ci.org/eweilow/node-svg-inliner.svg?branch=master)](https://travis-ci.org/eweilow/node-svg-inliner)

This inliner is used by me in several projects to inline SVG's in HTML (it prevents stutter and decreases the amount of requests!). It can also be used to clean SVG's.


# Usage
```javascript
var inliner = require("node-svg-inliner")(options);
var parsedsvg = inliner("path/to/a/svg/file");
```

## Options
- `baseDirectory` (default `__dirname`): the directory from which the inliner works relative to
- `allowedTags` (default `["p", "svg", "g", "path", "polygon", "rect"]`): the allowed SVG tags the inliner outputs
- `allowedAttributes` (default `["id", "fill", "points", "class", "d", "viewBox", "width", "height", "x", "y", "style", "transform"]`): the allowed SVG attributes the inliner outputs
- `cache` (default `true`): allow the inliner to cache processed SVG's in memory until the files change
- `removeNewLines` (default `false`): set if the SVG should come out with no newlines and as little whitespace as possible

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