Hi! i made a simple localStorage module to save my settings, maybe can help you
This is a quick example on how to use it:
var localStorage = require("localStorage").getInstance();
var settingsObject = localStorage.getObject('settings');
if (!settingsObject) {
console.log("setting not exists");
//here's how to set
localStorage.setObject('settings', { 'ssid': 'blablabla', 'password': 'blablabla' });
}
else {
console.log(settingsObject);
//use the settings
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi! i made a simple localStorage module to save my settings, maybe can help you
This is a quick example on how to use it:
var localStorage = require("localStorage").getInstance();
var settingsObject = localStorage.getObject('settings');
if (!settingsObject) {
console.log("setting not exists");
//here's how to set
localStorage.setObject('settings', { 'ssid': 'blablabla', 'password': 'blablabla' });
}
else {
console.log(settingsObject);
//use the settings
}
1 Attachment