Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Rich-Harris/svg-parser
https://github.com/Rich-Harris/svg-parser
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Rich-Harris/svg-parser
- Owner: Rich-Harris
- Created: 2017-09-23T16:20:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-08T19:31:48.000Z (about 2 years ago)
- Last Synced: 2024-05-15T15:07:12.594Z (4 months ago)
- Language: JavaScript
- Size: 87.9 KB
- Stars: 191
- Watchers: 5
- Forks: 15
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome - Rich-Harris/svg-parser - (JavaScript)
README
# svg-parser
Take a string representing an SVG document or fragment, turn it into [HAST](https://github.com/syntax-tree/hast) JavaScript object.
## Installation
`npm install svg-parser`, or grab it from [npmcdn.com/svg-parser](https://npmcdn.com/svg-parser).
## Usage
```js
import { parse } from 'svg-parser';const parsed = parse( `
` );
/*
{
type: 'root',
children: [
{
type: 'element',
tagName: 'svg',
properties: {
viewBox: '0 0 100 100'
},
children: [...]
}
]
}
*/
```## License
MIT