Miscellaneous
Other functions provided by Dubnium.
Directory
Change
db.config.dir = './new/dir'Make
db.dir()Get path
db.dirPathIterate
db.iterate(record => {})Parameter
About
Type
Required
callback
Callback
function
Create Symlink to a Record
db.get('tag').symlink('./path/to/symlink') Parameter
About
Type
Required
target
Path to a directory where the symlink will be created
String
Get Record's Stats
db.get('tag').statsContent to String & JSON
db.get('tag').toString() // returns content as stringdb.get('tag').toJSON() // returns content as an object, if possibleEnd
If you want to end a string of methods, you can with .end(). It emits the end event and no methods can be added after it. Note: this is not required.
db.get("tag").overwrite(content).end()Exit
If you wish to exit the Record editor API, call the exit() method and it will return the class.
db.get('tag').overwrite(content).exit().//any_class_functionFS
Run any fs method on the Record or database.
db.fs('methodName', ...method_args)db.get('tag').fs('methodName', ...method_args)Execute Bash
db.exec('command', (error, stdout) => {})Parameter
About
Type
Required
command
The command (include arguments)
string
callback
Callback
function
Internal Functions
Dubnium exports some internal functions that can be used in your project.
require('dubnium/functions')Aliases
Don't like the name we chose for a method? Set an alias!
db.alias('alais_here', 'existing_function')For example,
db.alias('val', 'getFromValue') // Allows you to call db.val() instead of db.getFromValue()Last updated
Was this helpful?