Key/value storage, local or remote
Find a file
2019-10-02 22:12:55 +02:00
src Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
.editorconfig Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
.gitignore Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
.gitlab-ci.yml Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
activate_node Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
jest.config.js Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
package-lock.json Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
package.json Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
README.md Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00
tsconfig.json Initial pre-version with only browser local storage 2019-10-02 22:12:55 +02:00

tk-storage

pipeline status coverage report npm version npm size

About

Javascript/Typescript persistent storage, with key-value stores as foundation.

Typescript definitions are included.

Issues can be reported on GitLab.

Install

Import in node:

npm install tk-storage
import { getLocalStorage } from "tk-storage";
const storage = getLocalStorage();

Import in browser:

<script src="https://unpkg.com/tk-storage"></script>
const storage = tkStorage.getLocalStorage();

Use

const storage = getLocalStorage();
await storage.get("key");  // => null
await storage.set("key", "value");
await storage.get("key");  // => "value"