You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
333 B

4 years ago
  1. #!/usr/bin/env node
  2. /* eslint no-var: 0 */
  3. var parser = require("..");
  4. var fs = require("fs");
  5. var filename = process.argv[2];
  6. if (!filename) {
  7. console.error("no filename specified");
  8. process.exit(0);
  9. }
  10. var file = fs.readFileSync(filename, "utf8");
  11. var ast = parser.parse(file);
  12. console.log(JSON.stringify(ast, null, " "));