Class

FSFileRead

FSFileRead()

Contains methods, that reads from file
Constructor

# new FSFileRead()

View Source fs-file.read.class.ts, line 9

Classes

FSFileRead

Methods

# createReadStream(options) → {PromiseLikeReadStream}

Open stream for read from file. Return stream, which can be awaitable while stream closed.
Parameters:
Name Type Description
options standard Node fs.createReadStream options

View Source fs-file.read.class.ts, line 134

- work as standart node ReadStream, but can act as Pomise wich resolves on stream 'close' event
PromiseLikeReadStream

# csvArrays(splitter) → {FSIterable.<Array.<string>>}

Read csv as array of arrays
Parameters:
Name Type Description
splitter

View Source fs-file.read.class.ts, line 58

FSIterable.<Array.<string>>

# csvArraysAsync(splitter) → {FSAsyncIterable.<Array.<string>>}

Read csv file as splitted strings array line-by-line with async iterator.
Parameters:
Name Type Description
splitter text symbol which used as delimeter

View Source fs-file.read.class.ts, line 103

FSAsyncIterable.<Array.<string>>

# csvWithHeader(splitter) → {FSIterable.<Record.<string, string>>}

Read csv as objects. Take first line as object keys
Parameters:
Name Type Description
splitter

View Source fs-file.read.class.ts, line 66

FSIterable.<Record.<string, string>>

# csvWithHeaderAsync(splitter) → {FSAsyncIterable.<Record.<string, string>>}

Read csv files and converts it to objects with keys from first line of file
Parameters:
Name Type Description
splitter text symbol which used as delimeter

View Source fs-file.read.class.ts, line 111

FSAsyncIterable.<Record.<string, string>>

# async json() → {Promise.<any>}

Read file and parses it to json object

View Source fs-file.read.class.ts, line 31

Promise.<any>

# lineByLine() → {FSIterable.<string>}

Read text files line by line

View Source fs-file.read.class.ts, line 38

FSIterable.<string>

# lineByLineAsync()

Read text file line-by-line with async iterator

View Source fs-file.read.class.ts, line 84

# async txt() → {Promise.<string>}

Returns all file content as string. On error throws NodeJS.ErrnoException

View Source fs-file.read.class.ts, line 18

Promise.<string>