# Initialize

{% tabs %}
{% tab title="Commonjs" %}
{% code lineNumbers="true" %}

```javascript
const Dubnium = require('dubnium')
const db = new Dubnium('dirPath', 'ext', options)
```

{% endcode %}

{% code lineNumbers="true" %}

```javascript
const db = new (require("dubnium"))("dir", "ext", options)
```

{% endcode %}
{% endtab %}

{% tab title="ECMAScript" %}
{% code lineNumbers="true" %}

```javascript
import Dubnium from 'dubnium'
const db = new Dubnium('dirPath','ext', options)
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
You can initialize as many databases as you want
{% endhint %}

### Parameters

<table><thead><tr><th width="197">Name</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>dirPath</td><td>The path to the directory to store Records.</td><td>String</td><td>true</td></tr><tr><td>ext</td><td>Custom file extension (default: <code>json</code>) </td><td>String</td><td>false</td></tr><tr><td>options</td><td>Options</td><td>Object</td><td>false</td></tr><tr><td>options.name</td><td>Database name</td><td>String</td><td>false</td></tr><tr><td>options.force</td><td>Enable force overwriting of a preexisting Record.</td><td>Boolean</td><td>false</td></tr><tr><td>options.preserveConfig</td><td>Set to <code>false</code> to not overwrite the config file</td><td>Boolean</td><td>false</td></tr><tr><td>options.versioning</td><td>Read more in <a href="/pages/3HHPjwUPXgwBXF68CseI">Versioning</a>.</td><td>Object</td><td>false</td></tr><tr><td>options.requireRoot</td><td>Functions to require root access to run</td><td>Array</td><td>false</td></tr><tr><td>options.template</td><td>Require all new JSON Records to follow a template, or Dubnium will throw an error</td><td><a href="/pages/JfgEEJMNrNiS1ARLcY2K">Template</a></td><td>false</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://db.coolstone.dev/3/api/initialize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
