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

220
Vistas
How to read contents of an SQL file in NodeJS?

I want to read the contents of an SQL file in NodeJS. Is there a simple way to do this? Even just to import the whole file as a string somehow would be good. It seems like a basic thing but I can't find any information on how to do it.

Any help would be greatly appreciated.

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

0

It turns out you can simply use fs.readFileSync("file_name.sql").toString() in the same manner you would a .txt file.

about 4 years ago · Juan Pablo Isaza Denunciar

0

you can try use XMLHttpRequest to import the file as a string.

https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest

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