Merge pull request #23797 from dex4er/csv2json

New typings for csv2json
This commit is contained in:
Daniel Rosenwasser
2018-03-05 16:52:36 -08:00
committed by GitHub
4 changed files with 52 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import csv2json = require("csv2json");
import fs = require("fs");
fs.createReadStream('data.csv')
.pipe(csv2json({
separator: ';'
}))
.pipe(fs.createWriteStream('data.json'));
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for csv2json 1.4
// Project: https://github.com/julien-f/csv2json
// Definitions by: Piotr Roszatycki <https://github.com/dex4er>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Writable } from "stream";
declare namespace csv2json {
interface Options {
dynamicTyping?: boolean;
separator?: string;
}
}
declare function csv2json(options?: csv2json.Options): Writable;
export = csv2json;
+24
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }