Javascript/Typescript encrypted data storage, using (possibly public) key/value databases

Michaël Lemaire e83a1fda32 Added docker config for server 2 months ago
.vscode e0307d4cbf Added remote storage based on rest server 2 months ago
dist e0307d4cbf Added remote storage based on rest server 2 months ago
src e83a1fda32 Added docker config for server 2 months ago
.dockerignore e0307d4cbf Added remote storage based on rest server 2 months ago
.editorconfig 340043beb7 Initial pre-version with only browser local storage 3 months ago
.gitignore 340043beb7 Initial pre-version with only browser local storage 3 months ago
.gitlab-ci.yml 340043beb7 Initial pre-version with only browser local storage 3 months ago
Dockerfile e83a1fda32 Added docker config for server 2 months ago
README.md e83a1fda32 Added docker config for server 2 months ago
activate_node b490f08862 Added node.js directory storage 2 months ago
jest.config.js b490f08862 Added node.js directory storage 2 months ago
package-lock.json d25c574444 0.3.0 2 months ago
package.json e83a1fda32 Added docker config for server 2 months ago
tsconfig.json b490f08862 Added node.js directory storage 2 months ago

README.md

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("myapp");

Import in browser:

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

Use

To get a storage locally persistent (saved in browser data or on disk for Node.js):

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

To get a storage remotely persistent (saved on a compliant server):

const storage = getRemoteStorage("myapp", "https://tk-storage.example.io/", { shared: true });
await storage.get("key");  // => null
await storage.set("key", "value");
await storage.get("key");  // => "value"

Run a server for remote storage:

npm run storageserver