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: about 1 year ago
JSON representation
Path that SVG!
- Host: GitHub
- URL: https://github.com/elrumordelaluz/path-that-svg
- Owner: elrumordelaluz
- Created: 2018-05-30T08:39:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:57:54.000Z (over 3 years ago)
- Last Synced: 2025-04-10T23:01:56.015Z (about 1 year ago)
- Topics: path, svg, svg-converter, svg-path
- Language: JavaScript
- Size: 576 KB
- Stars: 61
- Watchers: 2
- Forks: 5
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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`