import { parseFile , ParserOptionsArgs } from '@fast-csv/parse' ; import { Csv } from '../interfaces' ; export async function parseCsv ( file , opts ) { const rows = [ ] ; return new Promise ( ( resolve , reject ) => { parseFile ( file , opts ) . on ( 'error' , reject ) . on ( 'data' , ( data ) => rows . push ( data ) ) . on ( 'end' , ( ) => resolve ( rows ) ) ; } ) ; }