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

274
Vistas
Can you get the content of a github file with javascript?

Is there any way to get the content of a text file (txt/jss/html/...) with javascript or any other way, inserting it to a variable? (Also jquery is ok) I mean: abc.txt contains some text, that ttext should be stored into a variable. Thanks

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

0

Yeah, it's pretty straightforward all you have to do is change the string a little bit like so, for example here is json file from a github repo

https://github.com/arnav7633/tej.js/blob/main/tsconfig.json

now that string gets changed to

https://raw.githubusercontent.com/arnav7633/tej.js/main/tsconfig.json

The domain changes. Then make a simple axios/fetch query to that URL enter image description here

(async() => {
const res = await axios.get("https://raw.githubusercontent.com/arnav7633/tej.js/main/tsconfig.json")
console.log(res.data)
})()
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

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