> For the complete documentation index, see [llms.txt](https://db.coolstone.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://db.coolstone.dev/2/miscellaneous.md).

# Miscellaneous

## Directory

### Change <a href="#change-dir" id="change-dir"></a>

{% code lineNumbers="true" %}

```javascript
db.dirPath = './new/dir'
```

{% endcode %}

### Make <a href="#make-dir" id="make-dir"></a>

{% code lineNumbers="true" %}

```javascript
db.dir()
```

{% endcode %}

### Get path <a href="#get-dir" id="get-dir"></a>

{% code lineNumbers="true" %}

```
db.dirPath
```

{% endcode %}

### Iterate

```javascript
db.iterate(filepath => {})
```

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>callback</td><td>Callback</td><td>function</td><td>true</td></tr></tbody></table>

## Create Symlink (alias) to a Record <a href="#create-symlink" id="create-symlink"></a>

{% code lineNumbers="true" %}

```javascript
db.get('tag').createSymlink('./path/to/symlink') 
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>dirPath</td><td>Path to a directory where the symlink will be created</td><td>String, filepath</td><td>true</td></tr></tbody></table>

## Get Record's Stats <a href="#get-stats" id="get-stats"></a>

{% code lineNumbers="true" %}

```javascript
db.get('tag').stats
```

{% endcode %}

No parameters

## Content to String & JSON

{% code lineNumbers="true" %}

```javascript
db.get('tag').toString() // returns content as string
```

{% endcode %}

{% code lineNumbers="true" %}

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

{% endcode %}

No parameters

## End

If you want to *end* a string of methods, you can with `.end()`. It emits the [`end`](/2/events.md) event and no methods can be added after it. **Note: this is not required.**

{% code lineNumbers="true" %}

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

{% endcode %}

No parameters

## Exit&#x20;

If you wish to exit the Record editor API, call the `exit()` method and it will return the class.

{% code lineNumbers="true" %}

```javascript
db.get('tag').overwrite(content).exit().//any_class_function
```

{% endcode %}

No parameters

## Something missing? <a href="#other" id="other"></a>

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

{% code lineNumbers="true" %}

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

{% endcode %}

#### Get the return value <a href="#other-return-value" id="other-return-value"></a>

{% code lineNumbers="true" %}

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

{% endcode %}

### Custom

{% code lineNumbers="true" %}

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

{% endcode %}

{% code lineNumbers="true" %}

```javascript
db.custom((dubnium, dir_path) => {
//do anything here
})
```

{% endcode %}

### Plugins

{% content-ref url="/pages/bDJ47880MHThrXY6QhDf" %}
[Plugins](/2/plugins.md)
{% endcontent-ref %}

### Run bash command in the directory <a href="#bash" id="bash"></a>

{% code lineNumbers="true" %}

```javascript
db.bash('command', (error, stdout) => {})
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>command</td><td>The command (include arguments)</td><td>string</td><td>true</td></tr><tr><td>callback</td><td>Callback</td><td>function</td><td>true</td></tr></tbody></table>

#### Or if you wish to have it added to the API, [tell us](https://github.com/coolstone-tech/dubnium/discussions/new?category=feature-requests\&labels=enhancement)!

## returnType

### About <a href="#returntype-about" id="returntype-about"></a>

Some functions have the `returnType` parameter. The values accepted are `1` and `2`.&#x20;

### 1 <a href="#returntype-1" id="returntype-1"></a>

Return as **JSON**.

### **2** <a href="#returntype-2" id="returntype-2"></a>

Return as an **Array**.

{% code lineNumbers="true" %}

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

{% endcode %}
