Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Error de Socket.io Lista de parámetros de función de flecha mal formada
// sever.js function cpuStats() { return new Promise((resolve) => { os.cpuUsage((value) => { let data = { 'cpu': (value * 100).toFixed(0), 'cpuCnt' : os.cpuCount(), 'memory': memoryPer, // (os.freememPercentage() * 100).toFixed(2), 'memoryAva' : os.freemem(), 'memoryTot' : os.totalmem(), 'disk': usedInPercentage, //(os.totalmem() / 1024).toFixed(2) 'diskAva' : diskAvailable, 'diskTot' : diskTotal } resolve(data); }) }) } setInterval(() => { cpuStats() .then((data) => { console.log(data) // Testing socket.emit('serverData', data) }) }, 5000); // client socket.on('serverData', data )=>{ var cpu = document.getElementById('cpu'); var memory = document.getElementById('memory'); var disk = document.getElementById('disk'); cpu.innerText = data.cpu; memory.innerText = data.memory; disk.innerText = data.disk; });

En server.js, creé un objeto llamado datos usando promesa y luego . en el lado del cliente solo recibo este error: Uncaught SyntaxError: lista de parámetros de función de flecha mal formada

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

cambiar esta linea
socket.on('serverData', data )=>{

a
socket.on('serverData', data =>{...your code goes here});

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!