rename-variables
Safely rename JS variables
Installation
With your favorite package manager:
- packin:
packin add rename-variables
- component:
component install jkroso/rename-variables
- npm:
npm install rename-variables
then in your app:
var rename =
API
rename(node, from, to)
Recursively renames all identifiers with the name from
within node
to to
. It will abort once it reaches a scope where from
is shadowed.
var parse = parse // => parse('var b = 1') // => parse('b;var b') // => parse('function b(a){a}') // => parse('try{b}catch(a){a}')