Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

JsonLinesStream

OCP App SDK / JsonLinesStream

JsonLinesStream<T>

Superclass of stream file reader with the main
logic involve in processing a file line by line

Type parameters

  • T

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

constructor()

Signature

new JsonLinesStream<T>(streamBuilder: FileReadableStreamBuilder, rowProcessor: FileRowProcessor<T>, options: Options = {}): JsonLinesStream<T>;

Type parameters

  • T

Parameters

NameType
streamBuilderFileReadableStreamBuilder
rowProcessorFileRowProcessor<T>
optionsOptions

Returns

JsonLinesStream<T>

Overrides: FileStream.constructor

Defined in: src/util/JsonLinesStream.ts:55

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

NameType
targetstring

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 JsonLinesStream from an existing ReadableStream.

Signature

Static fromStream<T>(stream: ReadableStream, processor: FileRowProcessor<T>, options: Options = {}): JsonLinesStream<T>;

Type parameters

  • T

Parameters

NameTypeDescription
streamReadableStreamsource stream for the JsonLines data
processorFileRowProcessor<T>the row processor
optionsOptionsoptions to provide the JsonLinesParser Options

Returns

JsonLinesStream<T>

Defined in: src/util/JsonLinesStream.ts:25

fromUrl()

Build a JsonLinesStream that reads from a web resource.

Signature

Static fromUrl<T>(url: string, processor: FileRowProcessor<T>, options: Options = {}): JsonLinesStream<T>;

Type parameters

  • T

Parameters

NameTypeDescription
urlstringsource url for the JsonLines data
processorFileRowProcessor<T>the row processor
optionsOptionsoptions to provide the JsonLinesParser Options

Returns

JsonLinesStream<T>

Defined in: src/util/JsonLinesStream.ts:39