https://github.com/drom/wast-parser
WebAssembly AST parser
https://github.com/drom/wast-parser
Last synced: 4 months ago
JSON representation
WebAssembly AST parser
- Host: GitHub
- URL: https://github.com/drom/wast-parser
- Owner: drom
- License: mit
- Created: 2015-10-14T21:01:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-01T01:56:36.000Z (almost 8 years ago)
- Last Synced: 2025-09-16T09:35:25.142Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.51 MB
- Stars: 18
- Watchers: 3
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebAssembly parser
[](https://www.npmjs.org/package/wast-parser)
[](https://travis-ci.org/drom/wast-parser)
[](https://ci.appveyor.com/project/drom/wast-parser)
Takes WebAssembly S-expression (WAST) string and returns abstract syntax tree ([AST](https://github.com/drom/wast-spec)).
Inspired by [esprima](https://github.com/jquery/esprima)
## Use
### Node.js
```
npm i wast-parser --save
```
```js
var parser = require('wast-parser');
```
### CLI
First install globally `npm i wast-parser -g`
then invoke with a wast file `wast-parser > parsed_wast.json`
## Functions
### .parse()
```js
var ast = parser.parse('(module)');
```
## Testing
`npm test`
## Generating tests
`npm run testgen`
## License
MIT [LICENSE](https://github.com/drom/wast-parser/blob/master/LICENSE).