7 lines
210 B
TypeScript
7 lines
210 B
TypeScript
![]() |
import {parseAsync} from 'json2csv';
|
||
|
|
||
|
export default function csv(input: object, fields: string[], f: (err, data) => void) {
|
||
|
parseAsync(input)
|
||
|
.then(csv => f(null, csv))
|
||
|
.catch(err => f(err, null));
|
||
|
}
|