new LevelDatabase(dirName, options)
This main class of module
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
dirName |
String | |||||||
options |
Object |
Properties
|
- Source:
- See:
Members
app :ExpressApp
The express app
Type:
- ExpressApp
database
dirName :String
The directory name with database
Type:
Methods
all() → {any}
Get all data
Returns:
The data
- Type
- any
baseGet(key) → {any}
Get the data from LevelDatabase#database
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The name of the data you want to get |
Returns:
The data you want to get
- Type
- any
baseSet(key, value) → {any}
Set the data to LevelDatabase#database
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The name of the data you want to set |
value |
any | The data you want to set |
Returns:
The data you want to set
- Type
- any
convertTo(data, type) → {any}
Convert data from String to specified type
Parameters:
Name | Type | Description |
---|---|---|
data |
String | The data to convert from String |
type |
String | The type to convert from String |
Returns:
- Type
- any
delete(key) → {Boolean}
Delete the data
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The name of the data |
Returns:
Is the data deleted?
- Type
- Boolean
fetchFullType(data) → {String}
Fetch type
Parameters:
Name | Type | Description |
---|---|---|
data |
any | The data of you want to fetch type |
Returns:
The type of the data
- Type
- String
get(key) → {any}
Get the data from module
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The name of the data you want to get |
Returns:
The data you want to get
- Type
- any
has(key)
Check if the data is here
Parameters:
Name | Type | Description |
---|---|---|
key |
String |
push(key, value) → {any}
Push value to specified data
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The name of the data you want to push |
value |
any | The data you want to push |
Returns:
The array of the data
- Type
- any
set(key, value) → {any}
Set the data to module
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The name of the data you want to set |
value |
any | The data you want to set |
Returns:
The data you want to set
- Type
- any