# combo-db

> A simple database, used json

Latest version **1.0.4** (published 2023-01-20) · ISC license · 0 weekly downloads

## Install

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

## 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.0.4 |
| Published | 2023-01-20 |
| First published | 2022-12-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | MineCodeBr |
| Maintainers | minecodebr |
| Keywords | json-db, simple-db, save-keys, database |

## Links

- npm: https://www.npmjs.com/package/combo-db
- Repository: https://github.com/MineCodeBr/combo-db
- Homepage: https://github.com/MineCodeBr/combo-db#readme
- Issues: https://github.com/MineCodeBr/combo-db/issues
- npm.io page: https://npm.io/package/combo-db

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.4 (latest) — 2023-01-20
- 1.0.3 — 2023-01-18
- 1.0.2 — 2022-12-25
- 1.0.0 — 2022-12-24

## README

## Combo DB
A simple database, used json 

## Install
```bash
npm i combo-db
```

## Example
```js
const Database = require("combo-db")

const userId = 12345678910
const loves = ["cat", "dog"]

function main() {
    const db = new Database("users", { name: "TestUser", extension: "database" })
    //Generator file .database (Custom)

    //Set User
    db.set(userId, { xp: 0, coins: 0, loves: [] })

    //Add value on userId
    db.add(userId + ".xp", 2)
    db.add(userId + ".coins", 15)
    
    //Remove value on userId
    db.remove(userId + ".xp", 1)
    db.remove(userId + ".coins", 5)
   
    //Push on array
    for (const love of loves) {
        db.push(userId + ".loves", love)

    }
    
    //Get userId
    return db.get(userId)
}

console.log(main())
//Result: { xp: 1, coins: 10, loves: [ 'cat', 'dog' ] }
```
[Examples](https://github.com/MineCodeBr/combo-db/examples)



## Docs
```js
const options = {
    log: true, // return errors on terminal
    name: "Database", // set name of database
    extension: "json" //generator file custom
}

new Database("name", options)
```

# add
```js
  db.add("path", number)
```

# remove
```js
 db.remove("path", number)
```

# delete
```js
 db.delete("path")
```

# get
```js
 db.get("path")
```

# push
```js
 db.push("path", { object: true })
 db.push("path", { string: true })
```

# set
```js 
 const value = {
    string: "abc",
    number: 10
 }
 db.set("path", value)
```

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