diff --git a/types/csv2json/csv2json-tests.ts b/types/csv2json/csv2json-tests.ts new file mode 100644 index 0000000000..b211fd9aee --- /dev/null +++ b/types/csv2json/csv2json-tests.ts @@ -0,0 +1,8 @@ +import csv2json = require("csv2json"); +import fs = require("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..6906d3e925 --- /dev/null +++ b/types/csv2json/index.d.ts @@ -0,0 +1,19 @@ +// 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"; + +declare namespace csv2json { + interface Options { + dynamicTyping?: boolean; + separator?: string; + } +} + +declare function csv2json(options?: csv2json.Options): Writable; + +export = csv2json; diff --git a/types/csv2json/tsconfig.json b/types/csv2json/tsconfig.json new file mode 100644 index 0000000000..79a635ca7d --- /dev/null +++ b/types/csv2json/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": 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" }