I am looking for a reliable, trusty way to extract all block comments from a javascript file that have loaded into memory as a string.
I see a ton of options online for using regular expressions, but I was looking for a more fail-proof solution.
Namely, using either esprima (http://esprima.org) or falafel(https://github.com/substack/node-falafel), is there a way to take in a string representing some javascript code, and extract all the block comments, and return an array where each entry in the array is a string representing a single block comment?
Also, in case it wasn't clear, I need the parsing to be done in javascript as well (javascript parsing javascript).
Thanks!