Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

473
Vistas
How to manipulate local JSON file using JavaScript on the client side?

Context

A feature that I would like to implement is to add a local(client side) database as offline feature for my cordova app using basic html, css, and js. It would be a fallback in case the internet connection is cut off. What I thought was that it would store the request url and request data inside a local JSON file and would have an option later on to be able to resend those failed request if the internet connection is restored.

Question

Is there a method to manipulate (add/create, edit/update, and delete) a JSON file stored inside a client app using pure JS?

What I've done so far is import and read a JSON file inside my app folder using the following code:

fetch("./database.json")
  .then((response) => {
    return response.json();
  })
  .then((data) => console.log(data));

(if there's a better way to do it, feel free to give a feedback in the comments)

That works fine and all, but I can't find any method on how to add/edit/delete an object and save the changes to that same JSON file.

According to this post which is half a decade ago, it is not possible without doing it in the backend.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda