> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simular.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WriteFile

# Function: writeFile()

> **writeFile**(`path`, `content`, `append`): `string`

Defined in: [index.d.ts:1704](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1704)

Writes content to a file, returning the absolute path written to.

If the path is relative, it is resolved against the default cache location.
When `append` is true and the file already has content, a newline is
inserted before appending the new content. When `append` is false, the file
is overwritten.

## Parameters

### path

`string`

### content

`string`

### append

`boolean`

## Returns

`string`
