path-that-svg
v1.2.4
Published
<p align="center"> <img alt="Path that SVG!" title="Path that SVG!" src="https://cdn.rawgit.com/elrumordelaluz/path-that-svg/32de7c4d/logo.svg" width="450"> </p>
Downloads
4,548
Maintainers
Readme
Install
yarn add path-that-svg
Usage
String|Buffer
svg
const svgToPath = require('path-that-svg')
fs.readFile('./elements.svg', (err, input) => {
svgToPath(input).then(convertedFromBuffer => {
console.log({ convertedFromBuffer })
})
})
svgToPath(`<svg viewBox="0 0 500 200">
<rect
x="200"
y="50"
fill="#F16362"
stroke="#30456B"
stroke-width="5"
stroke-linecap="round"
stroke-linejoin="round"
width="100" height="100"/>
</svg>`).then(convertedFromString => console.log({ convertedFromString }))
Related
element-to-path Convert SVG element into path