Mi pregunta es, tengo un comando en la línea 10 y estoy tratando de volver a ejecutarlo en la línea 30. ¿Cómo puedo hacer esto? El detalle del comando de repetición está en el código.
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 } } }) } }) } }