GitXplorerGitXplorer
e

path-that-svg

public
61 stars
5 forks
11 issues

Commits

List of commits on branch master.
Unverified
6b0e3f5fa375cf7429be72f671951cb494fc485e

Update README with named import

eelrumordelaluz committed 5 years ago
Unverified
5215cdd488f1fc6fcb5234602136700ad289ca97

1.2.4

eelrumordelaluz committed 5 years ago
Unverified
19eca6d2705d5de463ba1376c42d0e966253c9af

Add named export

eelrumordelaluz committed 5 years ago
Unverified
a37a577e67fcccb8242d2134ba6225dab56e4ae9

Update svgson

eelrumordelaluz committed 5 years ago
Unverified
bcd175dde1d6a7d055dcb061a1b806c58e821bfa

Update dependencies

eelrumordelaluz committed 5 years ago
Unverified
5b1f3ea4912ec395b549332579ecd2b7ef3dce50

1.2.3

eelrumordelaluz committed 5 years ago

README

The README file for this repository.

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

yarn add path-that-svg

Usage

String|Buffer svg

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

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

pathThatSvg(`<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