I am trying to write to a file, however the path just isn't making sense. After messing around I found that this is what gets it to work:
async execute(interaction) {
interaction.guild.members.fetch()
.then( members => {
members = members.reduce((col, member) => col.set(`${member.user.username}#${member.user.discriminator}`, member.user.id), new Collection());
members.forEach( id => {
const data = require('../leaderboard.json');
data[id] = 0;
fs.writeFileSync('./leaderboard.json', JSON.stringify(data));
})
})

The reset command is supposed to add a list of discord user ids to leaderboard.json. Before running the command, leaderboard.json is just a set of empty brackets, and after it contains a list of the discord user ids. I attached a photo of my file layout, but what doesn't make sense is how the second fs.writeFileSync works when the path is './leaderboard.json' when it should be ../leaderboard.json