gkz / grasp

JavaScript structural search, replace, and refactor
http://graspjs.com
MIT License
1.28k stars 33 forks source link

Please increase the function to replace #22

Closed xiongsongsong closed 10 years ago

xiongsongsong commented 10 years ago

like this:

var code = grasp.replace('equery' , 'require($str)' , function( $str ){
    return path.join( __dirname , $str ) + '.js'
}, '... require("./a/b") ...')

//code ==> require('/User/test/a/b.js')

tks!

gkz commented 10 years ago

Good idea