Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elrumordelaluz/path-that-svg

Path that SVG!
https://github.com/elrumordelaluz/path-that-svg

path svg svg-converter svg-path

Last synced: 3 days ago
JSON representation

Path that SVG!

Awesome Lists containing this project

README

        


Path that SVG!


Sometimes is useful to have an svg done with paths instead of elements

such as rect, circle, ellipse, line, polyline or polygon.

Like when you apply Compound Path in Adobe Illustrator.

## Install

```zsh
yarn add path-that-svg
```

## Usage

`String|Buffer` svg

```js
const { pathThatSvg } = require('path-that-svg')

fs.readFile('./elements.svg', (err, input) => {
pathThatSvg(input).then((convertedFromBuffer) => {
console.log({ convertedFromBuffer })
})
})

pathThatSvg(`

`).then((convertedFromString) => {
console.log(convertedFromString)
})
```

## Related

[element-to-path](https://github.com/elrumordelaluz/element-to-path) Convert SVG element into `path`