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

80
Views
Saving/Updating Array of Objects

I have made a basic web scrapper that collects data from a webpage about apartment prices. Each time the script is run it generates an array that contains objects of the format:

apartments = [{
  date: "1/1/2022",
  time: "7:30 AM",
  floorPlanName: "Example",
  bedNumber: "1",
  floorPlanSize: "800",
  floorPlanPrice: "1800"
}]

I want to be able to save this data to my hard drive so I can analyze this data in excel. (I currently have it to save as a CSV). I want new data generated to be added to the CSV every time the script is ran.

I'm using nodeJS to do all this. What is the best way to update this file every time I run the script?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You should be able to use objects-to-csv for this use case

const ObjectsToCsv = require('objects-to-csv');
const sampleData = [{ id: 1, text: 'this is a test' }];
 
new ObjectsToCsv(sampleData).toDisk('./test.csv', { append: true });
about 4 years ago · Santiago Trujillo Report
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!