Repository
Current version released
4 years ago
Dependencies
std
Storage
A basic key-value storage for deno.
let storage = new LocalStorage
// load data
await storage.load()
// set data
storage.set({
key: "value",
key2: "value2"
})
storage.set([
["key", "value"],
["key2" ,"value2"]
])
storage.set("key","value")
// get data
// `note` get return shalow copy
storage.get("key") // "value"
storage.get(["key","key2"]) // ["value","value2"]
storage.keys() // ["key", "key2"]
storage.values() // ["value", "value2"]
storage.entries() // [["key", "value"], ["key2", "value2"]]
// check and delete data
storage.delete("key2")
storage.has("key2") // false
storage.clear() // {}
// sava data
await storage.save()