vsvg-parser
Version:
A minimal implementation of a svg parser used in vsvg
35 lines (26 loc) • 912 B
Markdown
# vsvg-parser ( virtual SVG parser ) [](https://travis-ci.org/jcblw/vsvg-parser)
vsvg-parser is a small lib that allow you to parser svg's server side or client side. Its still in early devlopment so expect bug and file issues. Primarly used in [vsvg]( https://github.com/jcblw/vsvg ).
## Install
$ npm install vsvg-parser
You can also use it with your [Browserify](http://browserify.org) bundles.
## Usage
```javascript
var parser = require( 'vsvg-parser' );
console.log( parser.parse( '<svg><line /></svg>' ) );
/*
[ { tagName: 'svg',
attributes: {},
children:
[ { tagName: 'line',
attributes: {},
children: [],
text: null,
inside: 0,
closed: true,
position: [ 0, 0 ] } ],
text: null,
inside: -1,
closed: true,
position: [ 0 ] } ]
*/
```