Version: v0.7.1 - Beta.  We welcome contributors & feedback.

File.read

File.read($filePath, $options = {}) -> list|string

Description

Read an entire file and return the List of lines.

The $filePath is relative to the data/files directory.

$lines = File.read('path/to/file.txt')

foreach $lines as $line {
    ...
}

Options

Option Value Description
join true/false Return a string where the lines are joined by newlines.
$fullText = File.read('path/to/file.txt', -join)

See Also