Thanks to two awesome people (Nick and Andy), for introducing me to Esprima. If you have never heard about Esprima, here is a quick intro.
Esprima is a high performance, standard-compliant ECMAScript parser written in ECMAScript
Esprima was created by Ariya Hidayat and is maintained by Ariya and a bunch of contributors. Ariya also gave a talk on Esprima a couple of years. I would recommend watching it before you continue.
As you can see from the above video, Esprima can be used for Static Analysis using the AST (Abstract Syntax Tree). It can be used for Dynamic tracing, which helps us in identifying how many times each function is called. It can also be used in editing tools and code transformations to implement code minification.
So, let us get started.