The easiest multi-platform SPA framework.
File-based key-value storage
import { CordovaKeyValueStorage } from "../../browser_modules/@frontle/cordova-keyvaluestorage/index.js";
// get instance
const cordovaKeyValueStorage = new CordovaKeyValueStorage();
// load storage
await cordovaKeyValueStorage.load();
// get storage directory entry
console.log(cordovaKeyValueStorage.getStorageDirEntry());
// save data
await cordovaKeyValueStorage.setItem('test', '123');
// get data
console.log(await cordovaKeyValueStorage.getItem('test')); // 123
Frontle
$ frontle install @frontle/cordova-keyvaluestorage --noBuild
Download Vanilla JS Library
https://github.com/Frontle-Foundation/cordova-keyvaluestorage
Creating a CordovaKeyValueStorage object. Single tone pattern used
const cordovaKeyValueStorage = new CordovaKeyValueStorage();
Load storage. You must run this function before you can use any of the other functions
await cordovaKeyValueStorage.load();
Get Storage directory entry
console.log(cordovaKeyValueStorage.getStorageDirEntry());
Save Value
await cordovaKeyValueStorage.setItem('test', '123');
Get Value
console.log(await cordovaKeyValueStorage.getItem('test')); // 123
The original author of @frontle/cordova-keyvaluestorage is MushStory