Created
August 14, 2018 13:23
-
-
Save Hugo-ter-Doest/982f61a170b031095f598810e49d6d13 to your computer and use it in GitHub Desktop.
Convert kata-dasar.txt to JSON
This file contains 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
var fs = require('fs'); | |
var oldFile = './data/kata-dasar.txt'; | |
var data = fs.readFileSync(oldFile, 'utf-8'); | |
var words = data.split('\n'); | |
console.log(words.length); | |
var newFile = './data/kata-dasar.json'; | |
fs.writeFileSync(newFile, JSON.stringify(words, null, 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment