https://github.com/atiilla/nodejs-express
https://github.com/atiilla/nodejs-express
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/atiilla/nodejs-express
- Owner: atiilla
- Created: 2019-11-18T19:21:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T13:52:57.000Z (almost 3 years ago)
- Last Synced: 2025-01-25T17:11:18.633Z (9 months ago)
- Language: JavaScript
- Size: 269 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
"# NodeJS-Express"
Express Rest API
from CSV file to JSON
different solution:
```fetch('data.csv').then(res=>res.text()).then(data=>{console.log(data)})``````
fetch('data.csv').then(res=>res.text()).then(data=>{
result = [];
data = data.split("\n");
keys = data[0].split(",");
values = data.slice(1,-1);
values.map(value=>{
value = value.split(",");
ress = {};
keys.map((key, k)=>{
ress[key] = value[k];
})
result.push(ress);
})
console.log({result})
})
```