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

364
Views
How can I edit file in JavaScript?

I want to be able to:

-edit the data of a .dat file on my computer for a website.

-pull data from the file to use it later on.

I know a tiny bit about javascript and heard javascript cannot directly edit databases.

Is a .dat file in my computer a database?

I have done a few things in Javascript for websites but I haven't done anything complicated completely myself. I created some websites before and I have a basic understanding of HTML and CSS.

Please phrase your response as simply as possible. Explain the meaning of any complicated but necessary terms.

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

0

You need some server-side script to access the filesystem of the server such as PHP or NodeJs...

Nodejs example here.

let fs = require('fs');

Appeding file:

fs.appendFile('mynewfile1.txt', 'Hello content!', function (err) {
  if (err) throw err;
  console.log('Saved!');
});

Delete file:

fs.unlink('mynewfile2.txt', function (err) {
  if (err) throw err;
  console.log('File deleted!');
});

Read file :

fs.readFile('demofile1.html', function(err, data) {
    if (err) throw err;
    console.log(data);
});
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!