Created
January 16, 2018 16:45
-
-
Save JoshCheek/dc2486a6f4dc6e5cc9b9ca8d7f14ce97 to your computer and use it in GitHub Desktop.
Started to go down a rabbit hole with JSX parsing, but going to stop now, y'all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const babylon = require('babylon') | |
const fs = require('fs') | |
const code = fs.readFileSync('omg.js', 'utf-8') | |
const ast = babylon.parse(code, {plugins: ['jsx']}) | |
console.dir(ast.program.body, {depth: 10}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Josh abc="123" def={this.lol}> | |
Some stuffs | |
</Josh> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment