# monoxity.db

> An easy to use SQLite wrapper for beginners and supports JSON objects and arrays

Latest version **2.0.0** (published 2022-06-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install monoxity.db
pnpm add monoxity.db
yarn add monoxity.db
bun add monoxity.db
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-06-19 |
| First published | 2022-03-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Monoxity Development |
| Maintainers | monoxity |
| Keywords | monoxity, db, sqlite, wapper, sqlite3, basic, easy |

## Links

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

## Dependencies (2)

- [sqlite](https://npm.io/package/sqlite.md) ^4.0.25
- [sqlite3](https://npm.io/package/sqlite3.md) ^5.0.2

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2022-06-19
- 1.0.1 — 2022-03-23
- 1.0.0 — 2022-03-23

## README

# MonoxityDB

> A simple SQLite database wrapper designed for beginners - developed and maintained with ♥ by Host#1291

## Installation

```bash
npm i monoxity.db
```

## Dependancies

MonoxityDB has dependancies to ensure it is usable, you need to install the dependancies for the wrapper to work

```bash
npm i sqlite sqlite3
```

## Usage

```typescript
import { MonoxityDB } from "monoxity/monoxity.db";

const database = new MonoxityDB({
  table: "monoxity",
  fileName: "monoxity",
});

await database.connect(); // This is mandatory or else you will face errors

// Set value (insert / update) - returns data on success
const data = await database.set("key", "value");

// Push a value to an array in the database (inspired by quick.db)
// The third boolean parameter is optional, duplicate array elements will be destroyed if set to true
const data = await database.push("key", "value", true);

// Remove a value from an array in the database (inspired by quick.db)
const data = await database.pull("key", "value");

// Return an array of objects containing the keys and values from the database
const data = await database.getAll();
const data = await database.getAll("key");

// Return an array of the first X number of objects containing the keys and values from the database
const data = await database.getFirst(10, "key");

// Return the value of a key from the database or return an optional default value
const data = await database.get("key", "defaultValue");

// Delete a key from the database
const success = await database.delete("key");

// Delete ALL keys from your database
const success = await database.destroy();

// Return a number of keys in the database
const rows = await database.rowCount();
```

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