diff --git a/types/csv2json/csv2json-tests.ts b/types/csv2json/csv2json-tests.ts new file mode 100644 index 0000000000..269d4c2dfe --- /dev/null +++ b/types/csv2json/csv2json-tests.ts @@ -0,0 +1,8 @@ +import csv2json from "csv2json"; +import fs from "fs"; + +fs.createReadStream('data.csv') + .pipe(csv2json({ + separator: ';' + })) + .pipe(fs.createWriteStream('data.json')); diff --git a/types/csv2json/index.d.ts b/types/csv2json/index.d.ts new file mode 100644 index 0000000000..f1c08c3e7c --- /dev/null +++ b/types/csv2json/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for csv2json 1.4 +// Project: https://github.com/julien-f/csv2json +// Definitions by: Piotr Roszatycki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Writable } from "stream"; + +export interface CSV2JSONOptions { + dynamicTyping?: boolean; + separator?: string; +} + +export default function csv2json (options: CSV2JSONOptions): Writable; diff --git a/types/csv2json/tsconfig.json b/types/csv2json/tsconfig.json new file mode 100644 index 0000000000..e9840faef7 --- /dev/null +++ b/types/csv2json/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "csv2json-tests.ts" + ] +} diff --git a/types/csv2json/tslint.json b/types/csv2json/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/csv2json/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }