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

128
Vistas
Is there a way to do or simulate busy/wait style input in browser javascript?

I want to convert some command line style programs into JavaScript for use in a browser. I'm planning on using xterm.js to orchestrate the terminal aspect of the project, but I'm at a loss for how to convert these to the asynchronous nature of JavaScript in the browser. These programs use busy/wait style input.. like this:

print ("what is your name")
name = input() // waits until user enters data
print ("hello ", name)
print ("how old are you")
age = input()  // waits until user enters data
...

I know I can redesign the whole program to be asynchronous, but I want to avoid that since it would be a pretty substantial amount of work. Is anyone aware of any techniques that can achieve this without a huge redesign?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to imitate a console, you can look at example on main page of Xterm.js website (source code).

You need to handle onData() event.

about 4 years ago · Juan Pablo Isaza Denunciar
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