Create a JSON-friendly object from an SVG string
npm install svg-parserTake a string representing an SVG document or fragment, turn it into HAST JavaScript object.
npm install svg-parser, or grab it from npmcdn.com/svg-parser.
``js
import { parse } from 'svg-parser';
const parsed = parse(
);``
/*
{
type: 'root',
children: [
{
type: 'element',
tagName: 'svg',
properties: {
viewBox: '0 0 100 100'
},
children: [...]
}
]
}
*/
MIT