# kanoxdb

> easy database to use

Latest version **1.1.2** (published 2021-06-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install kanoxdb
pnpm add kanoxdb
yarn add kanoxdb
bun add kanoxdb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2021-06-29 |
| First published | 2021-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | KANOX#2021 |
| Maintainers | kanox |

## Links

- npm: https://www.npmjs.com/package/kanoxdb
- npm.io page: https://npm.io/package/kanoxdb

## Recent versions

- 1.1.2 (latest) — 2021-06-29
- 1.1.1 — 2021-06-29
- 1.1.0 — 2021-06-29
- 1.0.9 — 2021-06-29
- 1.0.8 — 2021-06-29
- 1.0.7 — 2021-06-29
- 1.0.6 — 2021-06-29
- 1.0.5 — 2021-06-29
- 1.0.3 — 2021-06-29
- 1.0.2 — 2021-06-29
- 1.0.1 — 2021-06-29
- 1.0.0 — 2021-06-29

## README

*To install*

```
npm i kanoxdb
```

*create db*
```
const db = require('kanoxdb)

client.on('message', async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(prefix)) return;
    if(message.content.startsWith(`-create`)){
        db.create()//create the json file
        db.add(`${message.author.id}`, 1)//add 1 coins to everyone that send a message, instead of the bot.
        message.channel.send(`db is created !)//send success message
})
    }
})
```
or
```
const db = require('kanoxdb)
db.create()
client.on('message', async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(prefix)) return;
    db.add(`${message.author.id}`, 1)//add 1 coins to everyone that send a message, instead of the bot.
})
```
*set*
```
client.on('message', async message => {
    if(message.content.startsWith(`-set`)){
        let channel = message.mentions.channels.first()
        db.set(`welcomechannel`, channel.id)//set the name 'welcomechannel' with the value `${channel.id}`
        message.channel.send(`${channel} has been seted to welcomechannel`)
    }
})
```
*get*
```
client.on('message', async message => {
    if(message.content.startsWith(`-get`)){
        let welcomechannelID = db.get(`welcomechannel`)//get the channel id that we saved
        let welcomechannel = client.channels.cache.get(welcomechannelID)//fetch the channel with id that we saved 
        message.channel.send(`welcome channel is ${welcomechannel}`)//send mention of welcome channel
    }
})
```
*add*
```
client.on('message', async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(prefix)) return;
    if(message.content.startsWith(`-add`)){
        db.add(`${message.author.id}`, 1)//add 1 coins to everyone that send a message, instead of the bot.
    }
})
```
*delete*
```
client.on('message', async message => {
    if(message.content.startsWith(`-delete`)){
        db.delete(`welcomechannel`)//delete the welcomechannel key from the db
    }
})
```
*all*
```
client.on('message', async message => {
    if(message.content.startsWith(`-all`)){
        db.all().join("\n")//show you all the keys that you saved (like `welcomechannel` etc.)
    }
})
```

---
_Source: https://npm.io/package/kanoxdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
