How to write a JSON file with a list of discord.js statuses and import it into the main index.js?

//index.js

const statuses = [
 { name: "ABC", type: ActivityType.Streaming },
 { name: "DEF", type: ActivityType.Watching },
 { name: "GHI", type: ActivityType.Listening },
 { name: "JKL", type: ActivityType.Playing },
];
client.on('ready', (c) => {
  console.log(`✅ ${c.user.tag} is online!`);
  setInterval(() => {
    var newStatus = statuses[Math.floor(Math.random() * statuses.length)];
    client.user.setActivity(newStatus);
  }, 10000);
});


what should I write in my JSON file and how should I implement it? I want to put
const statuses = [
 { name: "ABC", type: ActivityType.Streaming },
 { name: "DEF", type: ActivityType.Watching },
 { name: "GHI", type: ActivityType.Listening },
 { name: "JKL", type: ActivityType.Playing },
];

as a seperate file and call it in my main index.js.
Was this page helpful?