csv-readliner
v0.1.3
Published
```shell npm i --save csv-readliner ```
Downloads
3
Readme
Installation
npm i --save csv-readliner
yarn add csv-readliner
Usage
const reader = require('csv-readliner');
const handler = async data => {
console.log(data);
await new Promise(
resolve =>
void setTimeout(function() {
console.log('Unlock handler');
resolve();
}, 1e2),
);
};
async function main() {
await reader('myfile.csv', handler, { skipHeader: true });
console.log('Done.');
}
API
function reader(
fileName: string,
handler: (data: Array<string>) => Promise<void>,
{
delimiter = ',',
skipHeader = false,
operationLimit = 1e4,
}: {|
delimiter: string,
skipHeader: boolean,
operationLimit: number,
|},
): Promise<void> {}