npm install local-json-store
const JSONStorage = require('./index').JSONStorage;
const js = new JSONStorage('./test');
js.setItem('testKey', {'aaa': 'bbb'});
console.log(js.getItem('testKey')['aaa']);
- All methods
- length
- setItem(key, value)
- getItem(key)
- removeItem(key)
- key(n)
- clear()
- Serializes to disk in the location specified during instantiation
- Associative array
jsonStorage['myKey'] = 'myValue'
and dot propertyjsonStorage.myKey = 'myValue'