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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb5ee9-48367.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb5ee9-48367.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?