solved Task 1

This commit is contained in:
schrom01 2022-10-27 10:47:06 +02:00
parent bfc7439f2d
commit a93cf6a284
2 changed files with 3 additions and 4 deletions

View File

@ -26,15 +26,13 @@ const csvToJson = function(data) {
} }
return obj return obj
}) })
return data return JSON.stringify(data)
} }
const startTime = Date.now() const startTime = Date.now()
let data = fs.readFileSync('./csv/population.csv', 'utf8') let data = fs.readFileSync('./csv/population.csv', 'utf8')
const endTime = Date.now() const endTime = Date.now()
console.log(csvToJson(data))
printStats('./csv/population.csv', endTime - startTime) printStats('./csv/population.csv', endTime - startTime)
fs.writeFileSync('./json/population.json', csvToJson(data))
fs.writeFileSync('./json/population.json', data)

File diff suppressed because one or more lines are too long