Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
Electron store data locally without localstorage

I have an Electron application built using JavaScript.

I need to store some data and still retain it after closing the application.

I have find many ways, like JSON and localstorage.

I can't edit JSON using JavaScript only. I need a server, but my application is local, I have many computers, and I can't host a localserver for each version of the application.

I found localstorage, but when I change the destination of the application, it deletes all data and it's a danger. Any problem in Electron and all data is deleted.

So I need to store data in Electron locally and read/write data using JavaScript.

I think with server-side. I can read/write, but I need a localhost, and my Electron application is just a client-side program, like a browser.

All my solutions have a problem. I need a database read/write client side and not localstorage.

I searched on the Internet along, but I couldn’t found anything.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Apparently there is no built-in way to do this apart from using localstorage.

If it is okay for you to use a third-party module and save your data in an unencrypted JSON file, you could use the electron-store module.

According to their documentation there is a simple CRUD API. This is an example from their GitHub README file:

const Store = require('electron-store');

const store = new Store();

store.set('unicorn', '🦄');
console.log(store.get('unicorn'));
//=> '🦄'

// Use dot-notation to access nested properties
store.set('foo.bar', true);
console.log(store.get('foo'));
//=> {bar: true}

store.delete('unicorn');
console.log(store.get('unicorn'));
//=> undefined

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda