Download lib/lowdb/adapters/LocalStorage.js from RamaZyx/StableBOT: direct link, hf CLI and curl.
- Browser
- Download file 367 Bytes
-
https://huggingface.co/RamaZyx/StableBOT/resolve/main/lib/lowdb/adapters/LocalStorage.js
- Command line
-
hf download hf://RamaZyx/StableBOT/lib/lowdb/adapters/LocalStorage.js
-
curl -L -o LocalStorage.js https://huggingface.co/RamaZyx/StableBOT/resolve/main/lib/lowdb/adapters/LocalStorage.js
367 Bytes
| class LocalStorage { | |
| constructor(key) { | |
| this.key = key; | |
| } | |
| read() { | |
| const value = localStorage.getItem(this.key); | |
| if (value === null) { | |
| return null; | |
| } | |
| return JSON.parse(value); | |
| } | |
| write(obj) { | |
| localStorage.setItem(this.key, JSON.stringify(obj)); | |
| } | |
| } | |
| module.exports = { LocalStorage }; | |