# svg-outline-stroke

> Transfrom svg strokes into filled paths

Latest version **1.3.1** (published 2021-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install svg-outline-stroke
pnpm add svg-outline-stroke
yarn add svg-outline-stroke
bun add svg-outline-stroke
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2021-04-08 |
| First published | 2017-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/svg-outline-stroke) |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 130 |
| Author | Lionel T |
| Maintainers | elrumordelaluz |

## Links

- npm: https://www.npmjs.com/package/svg-outline-stroke
- Repository: https://github.com/elrumordelaluz/outline-stroke
- Homepage: https://github.com/elrumordelaluz/outline-stroke#readme
- Issues: https://github.com/elrumordelaluz/outline-stroke/issues
- npm.io page: https://npm.io/package/svg-outline-stroke

## Dependencies (2)

- [sharp](https://npm.io/package/sharp.md) 0.28.1
- [potrace](https://npm.io/package/potrace.md) 2.1.8

## Recent versions

- 1.3.1 (latest) — 2021-04-08
- 1.3.0 — 2020-04-20
- 1.2.4 — 2019-12-24
- 1.2.3 — 2018-08-14
- 1.2.2 — 2018-05-24
- 1.2.1 — 2018-03-11
- 1.2.0 — 2017-12-15
- 1.1.3 — 2017-12-10
- 1.1.2 — 2017-12-10
- 1.1.1 — 2017-12-10
- 1.1.0 — 2017-12-05
- 1.0.1 — 2017-12-05
- 1.0.0 — 2017-12-01

## README

<p align="center">
  <img alt="Outline Stroke" title="Outline Stroke" src="/logo.svg" width="450">
</p>

<p align="center">
  Sometimes you need an <code>svg</code> image that have <code>stroke</code>d attributes in its
  <code>paths</code> but <strong>outlined</strong> like after applying <em>Outline Stroke</em> in <em>Adobe Illustrator</em> or <em>Convert to Outlines</em> in <em>SketchApp</em>
</p>

<p align="center">
  <a href="https://travis-ci.org/elrumordelaluz/outline-stroke">
    <img src="https://travis-ci.org/elrumordelaluz/outline-stroke.svg?branch=master" alt="Build Status">
  </a>
</p>

## Install

```zsh
yarn add svg-outline-stroke
```

## Usage

`String` input:

```js
const outlineStroke = require('svg-outline-stroke')

const strokedSVG = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
  <line x1="32" y1="16" x2="32" y2="48" fill="none" stroke="#202020" stroke-miterlimit="10" stroke-width="2"/>
  <line x1="48" y1="32" x2="16" y2="32" fill="none" stroke="#202020" stroke-miterlimit="10" stroke-width="2"/>
</svg>`

outlineStroke(strokedSVG).then(outlined => {
  console.log(outlined)
})
```

`Buffer` input:

```js
const fs = require('fs')
const outlineStroke = require('svg-outline-stroke')

fs.readFile('./source.svg', (err, data) => {
  if (err) throw err
  outlineStroke(data).then(outlined => {
    fs.writeFile('./dest.svg', outlined, err => {
      if (err) throw err
      console.log('yup, outlined!')
    })
  })
})
```

## Params

The second argument accepts `params` to apply directly when re-tracing the image, like `fill` color of the `path`, `background` and so on. Take a look into [potrace params](https://github.com/tooolbox/node-potrace#parameters)

```js
outlineStroke(strokedSVG, { color: '#bada55' }).then(outlined => {
  console.log(outlined, 'Outlined SVG with #bada55 `fill` color')
})
```

## Related

[micro-outline-stroke](https://github.com/elrumordelaluz/micro-outline-stroke)
Microservice with a public [endpoint](https://micro-outline-stroke.now.sh/)

[outline-stroke-cli](https://github.com/elrumordelaluz/outline-stroke-cli) CLI version

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