Created
April 17, 2022 10:34
-
-
Save neysidev/8a240f23680086b2420d0e07fcb63a31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs") | |
| fs.readFile("input.csv", "utf8", (err, data) => { | |
| if (err) return console.log(err) | |
| const content = [] | |
| data.split("\n").forEach(line => { | |
| content.push(line.split(",")) | |
| }) | |
| fs.writeFile("output.json", JSON.stringify(content), err => { | |
| if (err) return console.log(err) | |
| console.log("The file was saved!") | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment