You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mahdi
0cb8d673d7
|
2 years ago | |
---|---|---|
.. | ||
dist | 2 years ago | |
CHANGELOG.md | 2 years ago | |
README.md | 2 years ago | |
package.json | 2 years ago |
README.md
svg-parser
Take a string representing an SVG document or fragment, turn it into HAST JavaScript object.
Installation
npm install svg-parser
, or grab it from npmcdn.com/svg-parser.
Usage
import { parse } from 'svg-parser';
const parsed = parse( `
<svg viewBox='0 0 100 100'>
<!-- stuff goes here... -->
</svg>
` );
/*
{
type: 'root',
children: [
{
type: 'element',
tagName: 'svg',
properties: {
viewBox: '0 0 100 100'
},
children: [...]
}
]
}
*/
License
MIT