diff options
Diffstat (limited to 'node_modules/babylon/bin/babylon.js')
-rwxr-xr-x | node_modules/babylon/bin/babylon.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/babylon/bin/babylon.js b/node_modules/babylon/bin/babylon.js new file mode 100755 index 000000000..449ddfed0 --- /dev/null +++ b/node_modules/babylon/bin/babylon.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +/* eslint no-var: 0 */ + +var babylon = require(".."); +var fs = require("fs"); + +var filename = process.argv[2]; +if (!filename) { + console.error("no filename specified"); + process.exit(0); +} + +var file = fs.readFileSync(filename, "utf8"); +var ast = babylon.parse(file); + +console.log(JSON.stringify(ast, null, " ")); |