vk-bridge-level
v2.2.0
Published
Level abstraction for VK Bridge
Downloads
11
Readme
Level abstraction for VK Bridge
Use it for easy for getting access to easy database interface around VK Bridge Storage
Install
NPM
npm i vk-bridge-level
Yarn
yarn add vk-bridge-level
Usage
API Reference
Example
import {VkBridgeLevel} from 'vk-bridge-level'
import bridge from '@vkontakte/vk-bridge';
const db = new VkBridgeLevel(bridge, {valueEncoding: 'json'}) // valueEncoding will auto encode and decode your objects to json
const key = 'key'
const value = {test: 'test'} // object to store
await db.put(key, value)
await db.get(key).then(console.log) // will return value from storage
await db.iterator().next().then(console.log) // will return