2.2.5 • Published 2 years ago

cordova-keyvaluestorage v2.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

cordova-keyvaluestorage

File-based key-value storage

Usage

import cordova_keyvaluestorage from "browser_modules/cordova-keyvaluestorage/module.js";
const {CordovaKeyValueStorage} = cordova_keyvaluestorage;

// 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

Install

Frontle

frontle install cordova-keyvaluestorage

Download files

https://github.com/Artifriends-inc/cordova-KeyValueStorage

API

new CordovaKeyValueStorage()

Creating a CordovaKeyValueStorage object. Single tone pattern used

const cordovaKeyValueStorage = new CordovaKeyValueStorage();

.load(storageFolderName = 'cordovaKeyValueStorage')

Load storage. You must run this function before you can use any of the other functions

await cordovaKeyValueStorage.load();

.getStorageDirEntry()

Get Storage directory entry

console.log(cordovaKeyValueStorage.getStorageDirEntry());

.setItem(key, value, fileName = key)

Save Value

await cordovaKeyValueStorage.setItem('test', '123');

.getItem(key, fileName = key)

Get Value

console.log(await cordovaKeyValueStorage.getItem('test')); // 123

People

The original author of cordova-keyvaluestorage is MushStory

License

MIT

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago