3 Star 46 Fork 16

韩子卢 / boompack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.js 452 Bytes
一键复制 编辑 原始数据 按行查看 历史
韩子卢 提交于 2022-03-07 13:58 . 删掉无用引用
import { parse, print } from "recast";
import { readFile, writeFile } from "fs";
import path from "path";
import modifyAst from "./utils/modifyAst.js";
const fromPath = path.join("./test/from/index.js");
const toPath = path.join("./test/to/index.js");
readFile(fromPath, { encoding: "utf8" }, (err, sourceCode) => {
const ast = parse(sourceCode);
modifyAst(ast);
writeFile(toPath, print(ast).code, () => {
console.info("搞完");
});
});
JavaScript
1
https://gitee.com/vvjiang/boompack.git
git@gitee.com:vvjiang/boompack.git
vvjiang
boompack
boompack
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891