Dubnium
v2
v2
  • Install
  • Overview
  • Initialize
  • Manage
  • Get
  • Modify
  • Templates
  • CLI
  • Events
  • Plugins
    • Create
  • Miscellaneous
  • Update Log
  • Need more help?
Powered by GitBook
On this page
  • Directory
  • Change
  • Make
  • Get path
  • Iterate
  • Create Symlink (alias) to a Record
  • Get Record's Stats
  • Content to String & JSON
  • End
  • Exit
  • Something missing?
  • Other
  • Custom
  • Plugins
  • Run bash command in the directory
  • returnType
  • About
  • 1
  • 2

Was this helpful?

Miscellaneous

Directory

Change

db.dirPath = './new/dir'

Make

db.dir()

Get path

db.dirPath

Iterate

db.iterate(filepath => {})
Parameter
About
Type
Required

callback

Callback

function

Create Symlink (alias) to a Record

db.get('tag').createSymlink('./path/to/symlink') 
Parameter
About
Type
Required

dirPath

Path to a directory where the symlink will be created

String, filepath

Get Record's Stats

db.get('tag').stats

No parameters

Content to String & JSON

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

No parameters

End

db.get("tag").overwrite(content).end()

No parameters

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

No parameters

Something missing?

We have a other() method that can run any fs method on the Record or the custom() method to run a custom function without leaving the Record Editor API.

Other

db.get('tag').other('methodName', ...method_args)

Get the return value

db.get('tag').other('methodName', ...method_args).returns

Custom

db.get('tag').custom((record, record_path) => {
//do anything here
})
db.custom((dubnium, dir_path) => {
//do anything here
})

Plugins

Run bash command in the directory

db.bash('command', (error, stdout) => {})
Parameter
About
Type
Required

command

The command (include arguments)

string

callback

Callback

function

returnType

About

Some functions have the returnType parameter. The values accepted are 1 and 2.

1

Return as JSON.

2

Return as an Array.

db.getAll(1) // will return all the records as an {JSON: 'object'}
db.getAll(2) // will return all the records as an [Array]
PreviousCreateNextUpdate Log

Last updated 2 years 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.

Or if you wish to have it added to the API, !

end
Plugins
tell us