Skip to content

Commit 7668abc

Browse files
committed
📖 jsonToCSV usage
1 parent f9e2a83 commit 7668abc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,41 @@ readRemoteFile(
5151
);
5252
```
5353

54+
### 🎀 jsonToCSV
55+
56+
```javascript
57+
import { jsonToCSV } from 'react-native-csv'
58+
59+
const jsonData = `[
60+
{
61+
"Column 1": "1-1",
62+
"Column 2": "1-2",
63+
"Column 3": "1-3",
64+
"Column 4": "1-4"
65+
},
66+
{
67+
"Column 1": "2-1",
68+
"Column 2": "2-2",
69+
"Column 3": "2-3",
70+
"Column 4": "2-4"
71+
},
72+
{
73+
"Column 1": "3-1",
74+
"Column 2": "3-2",
75+
"Column 3": "3-3",
76+
"Column 4": "3-4"
77+
},
78+
{
79+
"Column 1": 4,
80+
"Column 2": 5,
81+
"Column 3": 6,
82+
"Column 4": 7
83+
}
84+
]`;
85+
86+
const results = jsonToCSV(jsonData);
87+
```
88+
5489
## Contributing
5590

5691
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

0 commit comments

Comments
 (0)