Projekt

Obecné

Profil

Stáhnout (341 Bajtů) Statistiky
| Větev: | Revize:
1
#!/usr/bin/env node
2
/* eslint no-var: 0 */
3

    
4
var babylon = require("..");
5
var fs      = require("fs");
6

    
7
var filename = process.argv[2];
8
if (!filename) {
9
  console.error("no filename specified");
10
  process.exit(0);
11
}
12

    
13
var file = fs.readFileSync(filename, "utf8");
14
var ast  = babylon.parse(file);
15

    
16
console.log(JSON.stringify(ast, null, "  "));
(1-1/2)