Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
});
});