Miscellaneous

Other functions provided by Dubnium.

Directory

Change

db.config.dir = './new/dir'

Make

db.dir()

Get path

db.dirPath

Iterate

db.iterate(record => {})
db.get('tag').symlink('./path/to/symlink') 

Get Record's Stats

db.get('tag').stats

Content to String & JSON

db.get('tag').toString() // returns content as string
db.get('tag').toJSON() // returns content as an object, if possible

End

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_function

FS

Run any fs method on the Record or database.

db.fs('methodName', ...method_args)

Execute Bash

db.exec('command', (error, stdout) => {})

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