https://github.com/bunlong/react-native-csv
react-native-csv is the fastest CSV (or delimited text) parser for React Native.
https://github.com/bunlong/react-native-csv
csv csvtojson jsontocsv multithread parser react react-native-csv react-papaparse reactjs
Last synced: about 1 month ago
JSON representation
react-native-csv is the fastest CSV (or delimited text) parser for React Native.
- Host: GitHub
- URL: https://github.com/bunlong/react-native-csv
- Owner: Bunlong
- License: mit
- Created: 2021-04-16T06:45:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-18T16:30:38.000Z (about 4 years ago)
- Last Synced: 2025-03-29T08:43:32.742Z (about 2 months ago)
- Topics: csv, csvtojson, jsontocsv, multithread, parser, react, react-native-csv, react-papaparse, reactjs
- Language: Java
- Homepage: https://react-native-csv.js.org
- Size: 17.6 MB
- Stars: 26
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
⭐️ Please support us by giving a star! Thanks! ⭐️# react-native-csv
react-native-csv is the fastest CSV (or delimited text) parser for React Native.
## 🔧 Installation
react-native-csv is available on npm. It can be installed with the following command:
```
npm install react-native-csv --save
```react-native-csv is available on yarn as well. It can be installed with the following command:
```
yarn add react-native-csv --save
```## 💡 Usage
### 🎀 readString
```javascript
import { readString } from 'react-native-csv';const str = `Column 1,Column 2,Column 3,Column 4
1-1,1-2,1-3,1-4
2-1,2-2,2-3,2-4
3-1,3-2,3-3,3-4
4,5,6,7`;const results = readString(str);
```### 🎀 readRemoteFile
```javascript
import { readRemoteFile } from 'react-native-csv';readRemoteFile(
url,
{
complete: (results) => {
console.log('Results:', results)
}
}
);
```### 🎀 jsonToCSV
```javascript
import { jsonToCSV } from 'react-native-csv'const jsonData = `[
{
"Column 1": "1-1",
"Column 2": "1-2",
"Column 3": "1-3",
"Column 4": "1-4"
},
{
"Column 1": "2-1",
"Column 2": "2-2",
"Column 3": "2-3",
"Column 4": "2-4"
},
{
"Column 1": "3-1",
"Column 2": "3-2",
"Column 3": "3-3",
"Column 4": "3-4"
},
{
"Column 1": 4,
"Column 2": 5,
"Column 3": 6,
"Column 4": 7
}
]`;const results = jsonToCSV(jsonData);
```## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## ❗ Issues
If you think any of the `react-native-csv` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
## 💪 Contribution
We'd love to have your helping hand on contributions to `react-native-csv` by forking and sending a pull request!
Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)
How to contribute:
- Open pull request with improvements
- Discuss ideas in issues
- Spread the word
- Reach out with any feedback## ⚖️ License
The MIT License [](https://opensource.org/licenses/MIT)