Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

atiilla/NodeJS-Express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"# 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})
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published