Created
July 15, 2021 02:15
-
-
Save znxkznxk1030/5ce545e714cbfc6aaa08952d50468aba to your computer and use it in GitHub Desktop.
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
let fs = require('fs'); | |
try { | |
let code = fs.readFileSync('in.txt', 'utf8'); | |
// console.log(code); | |
let codelines = code.split("\n").map(codeline => { | |
return "\"" + codeline.replace("\r","") + "\"" | |
}).join(",\n"); | |
console.log(codelines) | |
fs.writeFileSync('out.txt', codelines) | |
} catch (e) { | |
console.error('Error: ', e.stack); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment