CsvStream
OCP App SDK / CsvStream
CsvStream<T>
Superclass of stream file reader with the main
logic involve in processing a file line by line
Type parameters
T
Hierarchy
FileStream
<T
,Options
>.CsvStream
Index
Constructors
Accessors
Methods
Constructors
constructor()
Signature
new CsvStream<T>(streamBuilder: FileReadableStreamBuilder, rowProcessor: CsvRowProcessor<T>, options: Options = {}): CsvStream<T>;
Type parameters
T
Parameters
Name | Type |
---|---|
streamBuilder | FileReadableStreamBuilder |
rowProcessor | CsvRowProcessor <T > |
options | Options |
Returns
CsvStream
<T
>
Overrides: FileStream.constructor
Defined in: src/util/CsvStream.ts:58
Accessors
isFinished
Signature
isFinished(): boolean;
Returns
boolean
Inherited from: FileStream.isFinished
Defined in: src/util/FileStream.ts:44
Inherited from: FileStream.isFinished
Defined in: src/util/FileStream.ts:44
Methods
fastforward()
Signature
fastforward(target: string): Promise<null | string>;
Parameters
Name | Type |
---|---|
target | string |
Returns
Promise
<null
| string
>
Inherited from: FileStream.fastforward
Defined in: src/util/FileStream.ts:48
processSome()
Signature
processSome(): Promise<null | string>;
Returns
Promise
<null
| string
>
Inherited from: FileStream.processSome
Defined in: src/util/FileStream.ts:53
fromStream()
Build a CsvStream from an existing ReadableStream.
Signature
Static fromStream<T>(stream: ReadableStream, processor: CsvRowProcessor<T>, options: Options = {}): CsvStream<T>;
Type parameters
T
Parameters
Name | Type | Description |
---|---|---|
stream | ReadableStream | source stream for the csv data |
processor | CsvRowProcessor <T > | the row processor |
options | Options | options to provide the underlying parser, see https://github.com/mafintosh/csv-parser#csvoptions--headers |
Returns
CsvStream
<T
>
Defined in: src/util/CsvStream.ts:27
fromUrl()
Build a CsvStream that reads from a web resource.
Signature
Static fromUrl<T>(url: string, processor: CsvRowProcessor<T>, options: Options = {}): CsvStream<T>;
Type parameters
T
Parameters
Name | Type | Description |
---|---|---|
url | string | source url for the csv data |
processor | CsvRowProcessor <T > | the row processor |
options | Options | options to provide the underlying parser, see https://github.com/mafintosh/csv-parser#csvoptions--headers |
Returns
CsvStream
<T
>
Defined in: src/util/CsvStream.ts:42
Updated about 1 month ago