# artia.db

> A lightweight and efficient database library for Node.js.

Latest version **1.1.1** (published 2023-10-15) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-10-15 |
| First published | 2023-10-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Seu Nome |
| Maintainers | agorithmia-communtiy |
| Keywords | database, NoSQL, Node.js, storage, persistence |

## Links

- npm: https://www.npmjs.com/package/artia.db
- Repository: https://github.com/Miuzaki/artia.db
- Issues: https://github.com/Miuzaki/artia.db/issues
- npm.io page: https://npm.io/package/artia.db

## Dependencies (1)

- [fs](https://npm.io/package/fs.md) ^0.0.1-security

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2023-10-15
- 1.1.0 — 2023-10-15
- 1.0.7 — 2023-10-12
- 1.0.6 — 2023-10-12
- 1.0.5 — 2023-10-12
- 1.0.4 — 2023-10-11
- 1.0.3 — 2023-10-11
- 1.0.2 — 2023-10-11
- 1.0.0 — 2023-10-11

## README

# Artia.db

![GitHub License](https://img.shields.io/badge/license-ISC-blue.svg)

Artia.db is a lightweight and efficient database library for Node.js.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
  - [JavaScript Example](#javascript-example)
  - [TypeScript Example](#typescript-example)
- [API Reference](#api-reference)
  - [Constructor](#constructor)
  - [findUnique](#findunique)
  - [deleteUnique](#deleteunique)
  - [update](#update)
  - [findMany](#findmany)
  - [deleteMany](#deletemany)
  - [create](#create)
- [Contributing](#contributing)
- [License](#license)

## Installation

You can install Artia.db via npm:

```bash
npm install artia.db
```

# Usage

## JavaScript Example

```js
const { NoSQLDatabase } = require("artia.db");

const db = new NoSQLDatabase("mydata.json");

const newItem = {
  name: "John",
  age: 30,
};

db.create({ create: newItem });
const foundItem = db.findUnique({ where: { name: "John" } });
console.log(foundItem);
```

## TypeScript Example

```ts
import { NoSQLDatabase } from "artia.db";

const db = new NoSQLDatabase("mydata.json");

const newItem = {
  name: "John",
  age: 30,
};

db.create({ create: newItem });
const foundItem = db.findUnique({ where: { name: "John" } });
console.log(foundItem);
```

# API Reference

## Constructor

- `NoSQLDatabase(fileName: string)`

#### Creates a new instance of the database.

## findUnique

- `findUnique({ where: { field: value } }): T | null`

#### Finds a unique item in the database based on the specified criteria.

- `where`: An object with criteria to match for finding the item.

## deleteUnique

- `deleteUnique({ where: { field: value } }): boolean`

#### Deletes a unique item from the database based on the specified criteria.

- `where`: An object with criteria to match for deleting the item.

## update

- `update({ where: { field: value }, data: { field: value } }): T | null`

#### Updates an item in the database based on the specified criteria and new data.

- `where`: An object with criteria to match for updating the item.
- `data`: An object with new data to update the item.

## findMany

- `findMany({ where: { field: value } }): T[]`

#### Finds multiple items in the database based on the specified criteria.

- `where`: An object with criteria to match for finding multiple items.

# deleteMany

`deleteMany({ where: { field: value } }): number`

#### Deletes multiple items from the database based on the specified criteria.

- `where`: An object with criteria to match for deleting multiple items.

## create
`create({ create: T }): T`
#### Creates a new item and adds it to the database.

- `create`: An object with data for creating a new item.

## Contributing
Feel free to contribute to this project! Please follow our Contribution Guidelines.

## License
This project is licensed under the ISC License. See the LICENSE file for details.

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