Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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!
- Host: GitHub
- URL: https://github.com/elrumordelaluz/path-that-svg
- Owner: elrumordelaluz
- Created: 2018-05-30T08:39:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:57:54.000Z (almost 2 years ago)
- Last Synced: 2024-05-10T10:43:27.650Z (6 months ago)
- Topics: path, svg, svg-converter, svg-path
- Language: JavaScript
- Size: 576 KB
- Stars: 59
- Watchers: 3
- Forks: 5
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sometimes is useful to have ansvg
done withpath
s instead of elements
such asrect
,circle
,ellipse
,line
,polyline
orpolygon
.
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`