mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-15 06:48:25 +08:00
New typings for csv2json
This commit is contained in:
8
types/csv2json/csv2json-tests.ts
Normal file
8
types/csv2json/csv2json-tests.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import csv2json from "csv2json";
|
||||
import fs from "fs";
|
||||
|
||||
fs.createReadStream('data.csv')
|
||||
.pipe(csv2json({
|
||||
separator: ';'
|
||||
}))
|
||||
.pipe(fs.createWriteStream('data.json'));
|
||||
15
types/csv2json/index.d.ts
vendored
Normal file
15
types/csv2json/index.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// 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";
|
||||
|
||||
export interface CSV2JSONOptions {
|
||||
dynamicTyping?: boolean;
|
||||
separator?: string;
|
||||
}
|
||||
|
||||
export default function csv2json (options: CSV2JSONOptions): Writable;
|
||||
23
types/csv2json/tsconfig.json
Normal file
23
types/csv2json/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/csv2json/tslint.json
Normal file
1
types/csv2json/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user