1 |
|
2 | <h1 align="center">
|
3 | 👋 Welcome to <br><code>@expo/json-file</code>
|
4 | </h1>
|
5 |
|
6 | <p align="center">A library for reading and writing JSON files.</p>
|
7 |
|
8 |
|
9 |
|
10 | ## 🏁 Setup
|
11 |
|
12 | Install `@expo/json-file` in your project.
|
13 |
|
14 | ```sh
|
15 | yarn add @expo/json-file
|
16 | ```
|
17 |
|
18 | ## ⚽️ Usage
|
19 |
|
20 | ```ts
|
21 | import JsonFile, { JSONObject } from '@expo/json-file';
|
22 |
|
23 | // Create a file instance
|
24 | const jsonFile = new JsonFile<JSONObject>(filePath);
|
25 |
|
26 | // Interact with the file
|
27 | await jsonFile.readAsync();
|
28 | await jsonFile.writeAsync({ some: 'data' });
|
29 | ```
|