I'm trying to make a discord bot in js, that will write to the minecraft white-list. When I read whitelist.txt and use string.split ("\n")
, for example, a name is created in the field: Name\r. But I don't want this there, did I forget something? Thank you
const names = fs.readFileSync("C:\\Users\\Admin\\Desktop\\pack\\whitelist.txt", {
encoding: 'utf8'
});
var jmena = names.replace('\r', "").split("\n");
console.log(jmena);