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

169
Views
How to store value into json file from Nodejs
let data= {
        timestamp:time,
        OSName:osname,
        IP:userdata.IPv4,
        country:userdata.country_name,
        browser:broname
    }

I want to store these values into a JSON file or js file, so that I can fetch them later on. Please help me with this, how can I store them? Also, these value update every time when page reload; then a new object should be made.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

NodeJS has his own lib for this, fs (Docs).

You need to import it (I used Vanilla JS, for more general solution)
const fs = require('fs');

And then you can use writeFileSync to save it (Docs)
In your case, you would need to do something like this:
fs.writeFileSync(<filename>, JSON.stringify(<yourObject>));

about 4 years ago · Juan Pablo Isaza 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!