1 Star 0 Fork 17

ronle/boompack

forked from 韩子卢/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("搞完");
});
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/ronle/boompack.git
git@gitee.com:ronle/boompack.git
ronle
boompack
boompack
master

搜索帮助