shapepath
v0.0.1
Published
No-dependecy, fast and lightweight SVG Shape Parser and Compiler
Downloads
27
Maintainers
Readme
shapepath
No-dependecy, fast and lightweight SVG Shape Parser and Compiler
CDN
# unpkg
https://unpkg.com/shapepath
# npmcdn
https://npmcdn.com/shapepath
# jsDelivr
https://cdn.jsdelivr.net/npm/shapepath
Installing
$ npm install shapepath
# or
$ yarn add shapepath
Usage
var ShapePath = require('shapepath');
var toPoints = ShapePath.toPoints;
var toPath = ShapePath.toPath;
var RectSVG = toPoints({type:'rect',x:0,y:0,width:200,height:200});
var getAsPathD = toPath(RectSVG);
Methods
toPoints
Parse path string or rect, etc, inputs object parametrs to Array of Points
toPath
Converts Array of Points to Path string