How to check the language type of the code snippet?

what kind of code do I want to automatically identify a piece of text through the program?

after searching for a long time, I couldn"t find it, so I"d like to ask if there is a corresponding library.

preferably nodejs

Please!

Apr.15,2022

if (true){
    return
    }

how do you judge this segment?
because things can not be done, so we can only use exclusion, there is no guarantee that we can accurately judge, I have not heard of this tool

I only know that there are tools for judging text encoding, which is similar to yours, and the principle is statistics. You can do this through exclusion + statistics

Menu