This is a plugin for shift-refactor
. These methods are useful and commonly used but the implementations are not perfect and may transform JavaScript incorrectly.
$ npm install refactor-plugin-unsafe
const {refactor} = require('shift-refactor');
const unsafeMethods = require('refactor-plugin-unsafe');
const src = `/* js source */`;
const $script = refactor(src, unsafeMethods);
Rename a list of variables.
$script.massRename([['fromName', 'toName']]);