const LanguageDetect = require('languagedetect'); const lngDetector = new LanguageDetect(); // OR // const lngDetector = new (require('languagedetect')); console.log(lngDetector.detect('This is a test.')); /* [ [ 'english', 0.5969230769230769 ], [ 'hungarian', 0.407948717948718 ], [ 'latin', 0.39205128205128204 ], [ 'french', 0.367948717948718 ], [ 'portuguese', 0.3669230769230769 ], [ 'estonian',