https://github.com/mrblueblue/esprima-pretty-loader
pretty print or write esprima ast's
https://github.com/mrblueblue/esprima-pretty-loader
Last synced: 3 months ago
JSON representation
pretty print or write esprima ast's
- Host: GitHub
- URL: https://github.com/mrblueblue/esprima-pretty-loader
- Owner: mrblueblue
- Created: 2015-11-19T22:39:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-23T21:26:03.000Z (over 9 years ago)
- Last Synced: 2025-03-03T08:16:15.714Z (3 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# esprima-pretty-loader
Print or write out your code's AST in a pretty manner
## Installing
```javascript
npm install
```
## How to UseAdd it as a loader in your webpack config.
Support flags are `write`, `print`, and `export`. Their defaults are `false`, `true`, and `false`, respectively.
The `export` flag will make your AST an exportable object that you can `require` in.
```javascript
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loaders: ['babel', 'esprima-pretty?write']
}
]
},```
The above example will print out your code's AST as well as writing it to a file.To turn off printing and only write to a file, set the loader as `esprima-pretty?+write,-print`.
Note: this loader does not modify your source code. It only console.logs it and / or writes it to a file.
## Supported Syntax
ES5, ES6, and JSX