@maukode/siesvi
Version:
siesvi is CSV library that use typescript and provide CSV common functions from parsing, validation, to transformation.
13 lines (12 loc) • 470 B
TypeScript
import { Transform, TransformCallback } from "stream";
interface CsvParserConfig<T> {
delimiter: string;
headers?: string[];
}
type AllowedType = string | number | boolean | Date;
declare class CsvParser<T extends Record<string, AllowedType>> extends Transform {
private config;
constructor(config?: CsvParserConfig<T>);
_transform(chunk: Buffer, encoding: BufferEncoding, callback: TransformCallback): void;
}
export { CsvParser, CsvParserConfig };