# whale-db

> A Brazilian database that supports JSON(JavaScript Object Notation)

Latest version **0.0.3** (published 2022-02-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install whale-db
pnpm add whale-db
yarn add whale-db
bun add whale-db
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-02-15 |
| First published | 2022-02-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 61.6 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Belzinhu |
| Maintainers | belzinhu1234 |
| Keywords | database, data, json, db, whale, whale-db |

## Links

- npm: https://www.npmjs.com/package/whale-db
- Repository: https://github.com/Belzinhu/whale-db.git#main
- Homepage: https://github.com/Belzinhu/whale-db/tree/main#readme
- Issues: https://github.com/Belzinhu/whale-db/issues
- npm.io page: https://npm.io/package/whale-db

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.26.0

## Recent versions

- 0.0.3 (latest) — 2022-02-15
- 0.0.2 — 2022-02-15
- 0.0.1 — 2022-02-14

## README

<div>
    <center>
    <img src="attachments/logo.jpg">
</div>
<h1><p style="font-size: 30px"><p style="text-align: center"><strong>WHALE-DB</strong></p></p></h1>

<h2><p style="text-align: center">A great JSON-based and simple to use database.</p></h2>


# <p style="text-align: center">Introduction</p>

```js
const { Database } = require("whale-db");
const db = new Database(/*
    {
        path: "string/to/path", default: "database.json"
        prefix: "stringprefix" default: '/'
    }
*/)

db.set(`database/set`, 1)
```

Whale-db has many methods, list of them:
-  set
    <br>param: [key, set]
    <br>function: store something in the database 
- delete/del
    <br>param: [key]
    <br>function: delete something in database
- get
    <br>param: [key]
    <br>function: gets something in database
- add
    <br>param: [key, add]
    <br>function: adds something in database
- sub
    <br>param: [key, sub]
    <br>function: subs something in database
- pull
    <br>param: [key, ...names]
    <br>function: Remove arguments from a list according to the second parameter 
- put
    <br>param: [objectPut]
    <br>function: Insert an object into the database by deleting all data 
- write
    <br>param: [stringPut]
    <br>function: Insert an string into the database by deleting all data 
- pop
    <br>param: []
    <br>function: Remove the last element from the database  
- shift
    <br>param: []
    <br>function:Remove the first element from the database 
- at
    <br>param: [index]
    <br>function: acess elements by index in dataase
- first
    <br>param: []
    <br>function: get first element of database
- randomKey
    <br>param: []
    <br>function: get a random key of a value in dataase
- random
    <br>param: []
    <br>function: get a random value in dataase
- push
    <br>param: [key, ...values]
    <br>function: push many values in key in database
- unshift
    <br>param: [key, ...values]
    <br>function: empurrar muitos valores na chave no banco de dados para o primeiro elemento 
- clear
    <br>param: []
    <br>function: delete all datas of database
- search
    <br>param: []
    <br>function: Do a lookup using a callback in the database 
- all
    <br>param: [{ limit: Infinity, filter: () => true, collection: false }]
    <br>function: Format all database data and return them 
- has
    <br>param: [key]
    <br>function: Check if this value exists 
- size
    <br>param: []
    <br>function: return the length of database
- slice
    <br>param: [min, max]
    <br>function: Returns the all method bounded by min and max 
- reverse
    <br>param: []
    <br>function: reverse all database
- last
    <br>param: []
    <br>function: return the last value of database
- type
    <br>param: [key]
    <br>function: return the type of data of database

# <p style="text-align: center">Otherwise</p>

It is possible to manage the database from a "method" 

```js
db.acess.hi = 'Hi!'
db.save()
```

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