Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

291
Views
Can I read from an .env file in Javascript?

I'm not using using Node or anything like that, just pure Javascript. I want to read a value that is located in an .env file and display that value on my HTML page. I was able to use the following code to read from a json file that I created, but it would be great if I could reuse the .env file I already have so that I don't have to duplicate the information.

fetch("settings.json")
                .then(response => response.json())
                .then(json => {
                    document.getElementById("project-name").innerHTML=json["project-name"];
                });

If I replace my settings.json file with my .env file this doesn't work because it can't find the file (yes I double checked the location). Any tips?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!