The jquery.uls library provides jquery.uls.data which is a collection of language related data - script, direction, autonym, geographical information and a set of utility methods to look up this data. This was originally developed as part of ULS project and now widely used across many projects in WIkimedia.
I think it does not need to be a jquery dependent library, and should be usable even with nodejs and all. The Language selector can add it as a dependency.