fs.read
fs.read
Function
Read text file contents.
Syntax
fs(path).read()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| String | Returns the UTF-8 text content of the file. |
Example
file = fs('docs-read.txt') file.write('BT') result = file.read() // Output: BT print result
Notes
- Throw Chinese error when reading fails.
- This method reads as UTF-8 text.