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

271
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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