---
lang: en
title: 'API docs: testlab.testsandbox.writetextfile'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/testlab
permalink: /doc/en/lb4/apidocs.testlab.testsandbox.writetextfile.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/testlab](./testlab.md) &gt; [TestSandbox](./testlab.testsandbox.md) &gt; [writeTextFile](./testlab.testsandbox.writetextfile.md)

## TestSandbox.writeTextFile() method

Creates a new file and writes the given data as a UTF-8-encoded text.

**Signature:**

```typescript
writeTextFile(dest: string, data: string): Promise<void>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

dest


</td><td>

string


</td><td>

Destination filename, optionally including a relative path.


</td></tr>
<tr><td>

data


</td><td>

string


</td><td>

The text to write.


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;void&gt;


