1.1.1 • Published 6 months ago
@walletconnect/keyvaluestorage v1.1.1
keyvaluestorage
Isomorphic Key-Value Storage
Example
import KeyValueStorage from "keyvaluestorage";
const options = {
// required for React-Native platform
// package from @react-native-async-storage/async-storage
asyncStorage: AsyncStorage
// required for NodeJS platform
// sqlite database connection (in-memory supported)
database: 'foobar.db'
// optional for NodeJS platform
// sqlite table name (default: 'keyvaluestorage')
tableName: 'keyvaluestorage'
}
const storage = new KeyValueStorage(options)
// setItem
await storage.setItem('user1', { name: 'John Doe', age: 21 })
// getItem
const item = await storage.getItem('user1')
// removeItem
await storage.removeItem('user1')
API
export class IKeyValueStorage {
public getKeys(): Promise<string[]>;
public getEntries<T = any>(): Promise<[string, T][]>;
public getItem<T = any>(key: string): Promise<T | undefined>;
public setItem<T = any>(key: string, value: T): Promise<void>;
public removeItem(key: string): Promise<void>;
}
1.1.1
6 months ago
1.1.0
6 months ago
1.0.2-canary.fd2778a
7 months ago
1.0.2-canary.758d7ff
7 months ago
1.0.2-canary.0
7 months ago
1.0.2-canary.1
7 months ago
1.1.0-canary-1
6 months ago
1.1.0-canary-3
6 months ago
1.1.0-canary-2
6 months ago
1.0.2-canary-e580314
11 months ago
1.0.2
1 year ago
1.0.1-rc.1-1c715f7f
2 years ago
1.0.0-49ca143d
2 years ago
1.0.0-2e7a7497
2 years ago
1.0.0-64a80ca5
2 years ago
1.0.0-18aa85ed
2 years ago
1.0.1-rc.1
2 years ago
1.0.1-rc.2
2 years ago
1.0.0-e7baa6ef
2 years ago
1.0.0
2 years ago