Following
this blog by Ariya, I was able to run jsbeautify from inside V8. :)
Here, the jsbeautify was a javascript function that was complied in V8 and then the call to this function with a javascript snippet was compiled and the output was the beautified version of the snippet. :)
Next, I want to do something similar for minification, code refactoring etc. from inside V8. Will it possible to achieve this doing something similar with esprima? Does it make more sense to actually take V8's parse tree and work with it rather than working with esprima's minification?