Read File As Text
Controlled node
Overview
The Read File As Text node reads any selected library file and returns its raw text contents. Unlike Read Text File, its file picker accepts all file types, which is useful when you need to inspect or reuse text-based files that do not have a text/plain MIME type.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the file read. | - |
| File | FileSource | The file to read from the library. The picker accepts any file type. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the node has finished running. |
| Text | Data | The raw text contents of the selected file. If the file cannot be read as text, this output contains an error object. |
Runtime Behavior and Defaults
- Controlled Node: The node runs only when the Run event fires.
- Project Requirement: A runtime project ID is required so the node can read from the project library.
- File Selection: If File receives an array, the node reads the first file in the array.
- File Validation: The runtime requires a valid file reference with an
id. - Raw Text Parsing: The runtime uses the text parser and returns
rawTextthrough the Text output. - Error Handling: If the project ID, file reference, text parsing, or file read fails, Text contains an error object instead of text.
Example Usage
Inspect a Library File
- Select a file in the node panel, or connect a file reference from Find Library Files or Get Library Files to File.
- Trigger Run from a Start node or another event.
- Connect Text to Show, Split Text, or another text-processing node.
The node returns the file contents as raw text when the selected file can be parsed as text.
tip
Use Read Text File when you specifically want the file picker to show only plain text files.