Class: LevelDatabase

LevelDatabase(dirName, options)

new LevelDatabase(dirName, options)

This main class of module
Parameters:
Name Type Description
dirName String
options Object
Properties
Name Type Description
server Boolean Is server feature enabled?
Source:
See:

Members

app :ExpressApp

The express app
Type:
  • ExpressApp
Source:

database

The Level database created by vweevers, rvagg and ralphtheninja
Source:
See:

dirName :String

The directory name with database
Type:
Source:

Methods

all() → {any}

Get all data
Source:
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
Source:
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
Source:
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
Source:
Returns:
Type
any

delete(key) → {Boolean}

Delete the data
Parameters:
Name Type Description
key String The name of the data
Source:
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
Source:
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
Source:
Returns:
The data you want to get
Type
any

has(key)

Check if the data is here
Parameters:
Name Type Description
key String
Source:

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
Source:
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
Source:
Returns:
The data you want to set
Type
any