@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
81 lines (41 loc) • 1.28 kB
Markdown
---
lang: en
title: 'API docs: testlab.testsandbox.writejsonfile'
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.writejsonfile.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/testlab](./testlab.md) > [TestSandbox](./testlab.testsandbox.md) > [writeJsonFile](./testlab.testsandbox.writejsonfile.md)
## TestSandbox.writeJsonFile() method
Creates a new file and writes the given data serialized as JSON.
**Signature:**
```typescript
writeJsonFile(dest: string, data: unknown): 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">
unknown
</td><td markdown="1">
The data to write.
</td></tr>
</tbody></table>
**Returns:**
Promise<void>