mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
15 lines
317 B
JavaScript
Executable File
15 lines
317 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import { parse } from "..";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
const filename = process.argv[2];
|
|
if (!filename) {
|
|
console.error("no filename specified");
|
|
} else {
|
|
const file = readFileSync(filename, "utf8");
|
|
const ast = parse(file);
|
|
|
|
console.log(JSON.stringify(ast, null, " "));
|
|
}
|