29 lines
732 B
Markdown
29 lines
732 B
Markdown
|
|
# @svgr/hast-util-to-babel-ast
|
|||
|
|
|
|||
|
|
[](https://travis-ci.org/smooth-code/svgr)
|
|||
|
|
[](https://www.npmjs.com/package/@svgr/hast-util-to-babel-ast)
|
|||
|
|
[](https://github.com/smooth-code/svgr/blob/master/LICENSE)
|
|||
|
|
|
|||
|
|
Transforms HAST into Babel AST.
|
|||
|
|
|
|||
|
|
## Install
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
npm install --save-dev @svgr/hast-util-to-babel-ast
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Usage
|
|||
|
|
|
|||
|
|
```js
|
|||
|
|
import { parse } from 'svg-parser'
|
|||
|
|
import toBabelAST from '@svgr/hast-util-to-babel-ast'
|
|||
|
|
|
|||
|
|
const hastTree = parse(`<svg></svg>`)
|
|||
|
|
|
|||
|
|
const babelTree = hastToBabelAst(hastTree)
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## License
|
|||
|
|
|
|||
|
|
MIT
|