simple-storage module which lets you store persistent data
For storing preferences (user facing persistent data) use ko/prefs
For session data check out module:ko/session-storage
Based on the mozilla SDK simple-storage module
Example
var ss = require("ko/simple-storage").get("foo").storage; ss.foobar = "foo";
Methods
-
require("ko/simple-storage").get(name)
-
Get persistent data for the given name (will be created if it doesnt exist)
Use the storage property to write and retrieve data.
Parameters:
Name Type Description name
String Returns:
{storage: {}, filename: "...", jsonStore: {}}
- Type
- Object
-
require("ko/simple-storage").remove(name)
-
Remove/purge all persistent data for the given name
Parameters:
Name Type Description name
String Returns:
- Type
- Void