---
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 markdown="1">

dest


</td><td markdown="1">

string


</td><td markdown="1">

Destination filename, optionally including a relative path.


</td></tr>
<tr><td markdown="1">

data


</td><td markdown="1">

string


</td><td markdown="1">

The text to write.


</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;


