This is a very old question, but most answers from 2009 are outdated. As e.g. How to generate call-graphs for given javascript?
Using Google, I also found on npm this module https://www.npmjs.com/package/callgraph but it's not maintained and doesn't work.
So, I'm bringing this after a couple of years up again to see if anyone has created something to make a simple call graph based on a js file or a code snippet?
Edit:
Well after couple of months, I still havn't found anything. The closest i came was this JS Code to SVG Flowchart