I want to analyse source code written in multiple languages. So the library should tell me at least, which lines are comments and which are not. Optimally it could also tell me more specific stuff, such as variable declarations, language-specific keywords etc.
So it actually is similar to a language specific syntax-highlighter, just that it does not highlight the source code but annotates it and prints something like JSON output.
I found markdown-it for Markdown, but well, I would need it for many languages, such as Shell, JavaScript, Python, Scala, Go …