Skip to main content

Neutralinojs has a built-in shared key-value storage. It's like a global LocalStorage for all Neutralinojs modes. exposes methods for interacting with this storage feature.


The storage API persists all data records into .storage directory in the root directory of your application. If you want to clear all data records, delete the .storage directory.

storage.setData(key, data)#

Writes data into Neutralinojs shared storage. 


  • key String: A unique identifier.
  • data Object (optional): Data as a string. If this value is null or undefined, the specific data record will be erased from the disk.
JSON.stringify({ username: 'TestValue'})


Reads and returns data for a given Neutralinojs shared storage key. 


  • key String: Storage data record identifier.

Return String (awaited):#

Data string of the storage record.

let data = await'userDetails');
console.log(`Data: ${data}`);


Returns all storage keys.

Return Array (awaited):#

A string array of existing storage keys.

let keys = await;
console.log('Keys: ', keys);