# Overview

## Install&#x20;

Dubnium is available on npm or GitHub (requires Node.js) and is available for CommonJS and ECMAScript modules.

### npm <a href="#npm" id="npm"></a>

{% hint style="info" %}
We strongly recommend using npm.
{% endhint %}

```bash
npm i dubnium
```

Check out our [npm page](https://npmjs.com/dubnium).

### GitHub <a href="#github" id="github"></a>

<https://github.com/coolstone-tech/dubnium>

## Initialize

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

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

{% endcode %}
{% endtab %}

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

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

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

## Make Your First Record

{% code lineNumbers="true" %}

```javascript
db.create('tag', content)
```

{% endcode %}

## Get a Record

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

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

{% endcode %}
{% endtab %}

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

```javascript
db.getAll({ tagOnly:false })
```

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

## Delete a Record

{% code lineNumbers="true" %}

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

{% endcode %}

## Modify a Record

{% tabs %}
{% tab title="Content" %}
{% hint style="danger" %}
This will overwrite your record with the content provided.
{% endhint %}

{% code lineNumbers="true" %}

```javascript
db.get('tag').write("new_content")
```

{% endcode %}
{% endtab %}

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

```javascript
db.get("old_tag").setTag("new_tag")
```

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

#### Check out our full docs for more API methods and in-depth explanations.
