Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda