Detection encoding of string according to one-byte representation.
const detectEncoding = require('detect-onebyte-encoding');
console.log(detectEncoding('привет'))
// cp1251
console.log(detectEncoding('żywność'))
// cp1250
npm install detect-onebyte-encoding