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

153
Views
Is there a way to save an appended JSON object in JavaScript?

I have a large json file with ~45,000 objects and 15 million keys that I've managed to append with JavaScript. I'm able to log out the new, desired json object but only for about 600 of the 45,000 objects. Is it possible to save the updated object to a file?

I'm looking to either:

  1. Overwrite the original file with the new content.
  2. Save the updated object to new file.
  3. Use any alternative option that will let me work with the output of this code in its entirety.

I'm very new so just getting to this point was a massive feat. I'd apprecitate any guidance and insight you have to offer.

Here is my code:

var data = require('./BC_Data.json');
var y = data.features.map((property) => property.properties.GAZETTED_NAME)

var language = {
    waterbody: ""
}

for (var i=0; i < y.length; i++) {
var input = data.features[i].properties.GAZETTED_NAME;

    if (input != null) {
    var sentence = input.toLowerCase().split(" ");
    for (var x=0; x < sentence.length; x++) {
        sentence[x] = sentence[x][0].toUpperCase() + sentence[x].slice(1)
    } 
    language.waterbody = sentence.join(" ")
    var obj = Object.assign(data.features[i], language)
    console.log(obj) // Desired Output to be saved
    } else 
    language.waterbody = ""
}
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!