> For the complete documentation index, see [llms.txt](https://daseldocs.tomwright.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daseldocs.tomwright.me/functions/readfile.md).

# readFile

`readFile` allows you to read file contents at runtime and use the results in your selectors.

A common use-case may be to send the output into a [`parse`](/functions/parse.md) call.

Accepts 1 arguments:

1. Filepath

## Example

### Simple text

```
$greeting = readFile("greeting.txt");
$name = readFile("name.txt");
$greeting + " " + $name;
// "Hello Tom"
```

### Parsing file contents

```
// Assuming names.json contains ["Tom", "Jim"]
$names = parse("json", readFile("names.json"));
len(names)
// 2
```
