Skip to content

Instantly share code, notes, and snippets.

@Soffcsr
Created April 28, 2020 00:22
Show Gist options
  • Save Soffcsr/86c732159802c48c0d9bf608a16c8915 to your computer and use it in GitHub Desktop.
Save Soffcsr/86c732159802c48c0d9bf608a16c8915 to your computer and use it in GitHub Desktop.
//modulos CORE
var os = require('os');
var fs = require('fs');
//modulos propios
var [suma, resta, multiplicacion, division] = require('./operaciones');
var cpu = os.cpus();
var cpu_string = JSON.stringify(cpu);
var sistema = os.platform();
var hostname = os.hostname();
fs.appendFile('salida.txt', `OPERACIONES suma: ${suma(10, 2)}, resta: ${resta(10, 2)}, multiplicacion: ${multiplicacion(10, 2)}, division: ${division(10, 2)}, COMPUTADORA DE: cpus: ${cpu_string}, SO: ${sistema}, hostname: ${hostname}`, function(error){
if(error){
console.log("Error al crear el archivo.");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment