Store
class Store is the primitive class for composing higher storage class. This class wrap levelup for connect with abstract-leveldown compliant stores.
Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
async connect() |
|
public |
async delItem(key: String ): Promise Delete item given the item key |
|
public |
async getItem(key: String , asBuffer: boolean): Object Get item given the key |
|
public |
async getItemList(namePrefix: String ): Array Get the current items under the prefix path |
|
public |
makeCheckItemNameFn(pattern: String ): Function Make name maching function based on prefix path |
|
public |
async setItem(key: String , data: Object ): Promise Set new item with the given key and value |
Public Constructors
public constructor() source
Public Methods
public async connect() source
public async delItem(key: String ): Promise source
Delete item given the item key
Params:
Name | Type | Attribute | Description |
key | String | key name to delete |
Return:
Promise | deleted key promise |
public async getItem(key: String , asBuffer: boolean): Object source
Get item given the key
Params:
Name | Type | Attribute | Description |
key | String | key name |
|
asBuffer | boolean |
|
return object or buffer array, default object |
Return:
Object | item object |
public async getItemList(namePrefix: String ): Array source
Get the current items under the prefix path
Params:
Name | Type | Attribute | Description |
namePrefix | String |
Return:
Array | list of item names |
public makeCheckItemNameFn(pattern: String ): Function source
Make name maching function based on prefix path
Params:
Name | Type | Attribute | Description |
pattern | String | prefix name |
Return:
Function | name matching function |
public async setItem(key: String , data: Object ): Promise source
Set new item with the given key and value
Params:
Name | Type | Attribute | Description |
key | String | key name of item |
|
data | Object | value of item |
Return:
Promise | new key promise |