jscodeshift-transformcommon
v1.0.0
Published
Allows you to transform javascript code synchronously with jscodeshift
Downloads
2
Readme
Use jscodeshift inside of js, without extra fs activity.
const j = require("jscodeshift-transformcommon").api;
const fs = require("fs");
const code = fs.readFileSync("./hello.js", "utf-8");
const e = j(code).find(j.Literal).filter(p => typeof p.node.value == "string").forEach(p => {
j(p).replaceWith(
j.literal(p.node.value + ", world!")
)
})