How to use the iconv-lite/lib/index.decode function in iconv-lite

To help you get started, we’ve selected a few iconv-lite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DaanBroekhof / JoroDox / app / utils / CsvReaderHelper.js View on Github external
const csvData = await new Promise((resolve, reject) => {
      csvparser(iconv.decode(jetpack.read(filepath, 'buffer'), 'win1252'), {
        delimiter: ',',
        skip_empty_lines: true,
        relax_column_count: true,
        columns: ['name', 'example', 'description', 'type', 'version_added'],
      }, (error, data) => {
        if (error) {
          reject(error);
        } else {
          resolve(data);
        }
      });
    });