Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 658 Bytes

Readme.md

File metadata and controls

29 lines (18 loc) · 658 Bytes

jsx

Go Reference

JSX parser for .jsx and .tsx files.

This package is primarily used to rewrite JSX in JS files (think styled-jsx). This package does not parse JS, rather it finds JSX within JS.

Install

go get github.com/matthewmueller/jsx

Usage

input := `export default () => <h1>hello world</h1>`
ast, _ := jsx.Parse("input.jsx", input)
fmt.Println(ast.String())

Contributors

License

MIT