Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

162
Vistas
NodeJS re-run a command in a row

My question is like, i have a command in 10th line and i am trying to rerun it in 30th line. How can i do this? The detail of rerun command is in the code.

Javascript;

import * as readline from 'node:readline/promises';
import { stdin as input, stdout as output } from 'node:process';
import * as fs from 'node:fs';
import moment from 'moment';
import * as process from 'node:process';

moment.locale("tr")
const saat = moment().format("DD MMMM dddd YYYY, HH:mm:ss");
const NotSaat = "["+saat+"]: "
const girdi = readline.createInterface({ input, output });

var GirisSorusu = await girdi.question("")

if(GirisSorusu.toLowerCase() == "hey therria" ||  "hey therria." || "hey therria!") {
 const heyterya = await girdi.question("Terya: Buyrun efendim?\n")
  if(heyterya.toLowerCase() == "not al" ||  "not al." || "not al!") {
   const nots = await girdi.question("Therria: Ne almamı istersiniz?\n")
   const NotRewrite = NotSaat + nots + "\n";
    fs.open("notlar/notlar.txt", "a", (err, fd)=>{
    if(err){
        console.log("Dosyaya erimeye çalışırken bir hata oluştu: " + err);
    }else{
        fs.write(fd, NotRewrite, async(err, bytes)=>{
            if(err){
                console.log("Dosyaya yazmaya çalışırken bir hata oluştu: ");
            }else{
                const notaldim = await girdi.question("Therria: Notunuzu aldım, başka bir isteğiniz var mı?\n") 
                 if(notaldim.toLowerCase == "yok" || "yok." || "yok!") {
                    await process.exit()
                 } else if (notaldim.toLowerCase == "evet" || "evet." || "evet!"); {
                    // Here is mine rerun command line, i want to rerun "heyterya" command
               } 
            }
        })        
    }
})
 }
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda