Answers for "node js check ram usage"

0

process memory usage javascript

const arr = [1, 2, 3, 4, 5, 6, 9, 7, 8, 9, 10];
arr.reverse();
const used = process.memoryUsage().heapUsed / 1024 / 1024;
console.log(`The script uses approximately ${Math.round(used * 100) / 100} MB`);
Posted by: Guest on April-16-2020
0

node js check ram usage

const Discord = require('discord.js');
const client = new Discord.Client();
const config = require("./config.json")




client.on("ready", () => {
    console.log(`Bot Foi Iniciado, com ${client.users.cache.size} usuários, em ${client.channels.cache.size} canais, em ${client.guilds.cache.size} servidores.`);
    client.user.setActivity(`Dinheiro Na Putaria`);
    client.user.setUsername('Hidrz')
});
const prefix = "!";

client.on("message", async message => {

    if (message.author.bot) return;
    if (message.channel.type == 'dm') return;
    if (!message.guild) return;
    if (!message.content.toLowerCase().startsWith(config.prefix.toLowerCase())) return;
    if (message.content.startsWith(`<@!${client.user.id}>`) || message.content.startsWith(`<@${client.user.id}>`)) return;

   const args = message.content
       .trim().slice(config.prefix.length)
       .split(/ +/g);
   const command = args.shift().toLowerCase();

   try {
       const commandFile = require(`./commands/${command}.js`)
       commandFile.run(client, message, args);
   } catch (err) {
   console.error('Erro:' + err);
   }
    
   
    

    
});
   



client.login(config.token)
Posted by: Guest on April-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language