Dubnium
v3
v3
  • Overview
  • API
    • Initialize
    • Manage
    • Get
    • Edit
    • Search
    • Miscellaneous
    • Middleware
    • Versioning
  • TEMPLATES
    • JSON
    • String
  • EXTENSIONS
    • Setup
    • Create
    • Find
  • OTHER
  • CLI
  • Events
  • Update Log
  • EXTERNAL LINKS
    • Need more help?
    • Report an Issue
Powered by GitBook
On this page
  • Directory
  • Change
  • Make
  • Get path
  • Iterate
  • Create Symlink to a Record
  • Get Record's Stats
  • Content to String & JSON
  • End
  • Exit
  • FS
  • Execute Bash
  • Internal Functions
  • Aliases

Was this helpful?

  1. API

Miscellaneous

Other functions provided by Dubnium.

Directory

Change

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

Make

db.dir()

Get path

db.dirPath

Iterate

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').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

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)
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()
PreviousSearchNextMiddleware

Last updated 1 year ago

Was this helpful?

If you want to end a string of methods, you can with .end(). It emits the event and no methods can be added after it. Note: this is not required.

end