Let's say, for example, I have a file like this:
function foo() {
const a = "hello";
return a;
}
function bar() {
console.log("there");
}
I want to write something that could print the output like this:
functions:
foo
bar
consts/variables:
foo.a // format here doesn't matter really, just illustrating
Is there any way I could do this without modifying the original file in pure js? Or is text parsing the only real way to go here?