Is there a way to generate bindings for a list of JS files?



Suppose I would like to generate bindings for, say, all the highlight.js languages.

Manually, I could go:

  external langJs: langPlugin = "highlight.js/lib/languages/javascript";
  external langOcaml: langPlugin = "highlight.js/lib/languages/ocaml";
  external langReasonml: langPlugin = "highlight.js/lib/languages/reasonml";
  external langTs: langPlugin = "highlight.js/lib/languages/typescript";
  let langAll = [langJs, langOcaml, langReasonml, langTs];

Sure enough, I could use ls and suchlike, so it’s not prohibitively tedious, but the list is still rather tedious and error-ptone to update. Does a better way exist?