# file-based-database-asadbek

> This database system was created to learn node fs module, And with using this database you may learn how fs module works, also you are able to use this package in order to add database to your project

Latest version **1.0.9** (published 2021-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install file-based-database-asadbek
pnpm add file-based-database-asadbek
yarn add file-based-database-asadbek
bun add file-based-database-asadbek
```

## 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.9 |
| Published | 2021-03-19 |
| First published | 2021-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zoirovasadbek |
| Maintainers | zoirovasadbek |
| Keywords | fs, usersystem, file-system, database, file, system, asadbek |

## Links

- npm: https://www.npmjs.com/package/file-based-database-asadbek
- npm.io page: https://npm.io/package/file-based-database-asadbek

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.9 (latest) — 2021-03-19
- 1.0.8 — 2021-03-19
- 1.0.7 — 2021-03-19
- 1.0.6 — 2021-03-18
- 1.0.5 — 2021-03-18
- 1.0.4 — 2021-03-18
- 1.0.3 — 2021-03-18
- 1.0.2 — 2021-03-18
- 1.0.1 — 2021-03-18
- 1.0.0 — 2021-03-18

## README

# Introduction

- Create your javascript file
- Import package:

```
const Database = require("file-based-database-asadbek");
```

# Install

```text
npm install file-based-database-asadbek
```

```text
yarn add file-based-database-asadbek
```

# How to use?

### Creating new Database

```javascript
const Database = require("file-based-database-asadbek");

let db = new Database("project_name", __dirname); // first argument should be your project name (string), second argument should be __dirname(don't change it);
```

#### The database looks like this:

```javascript
{
    "users": [
        {
            id: 1,
            name: Asadbek,
            age: 19,
            langs: ["english", "korean", "uzbek", "russian"]
        } // ...
    ]
}
```

### Main functions

#### There are 6 main functions to use

#### You should call functions like this:

```javascript
(async function () {
  // here goes functions
  await db.createUser(name, age, langs);
})();
```

###

```javascript
(async function () {
  // 1
  await db.createUser(name, age, langs);
  // 2
  await db.select(key, value); // you can select users by keyword and its value
  // 3
  await db.filter(obj); // you should call this function with argument wich is should be an object, and output will be as an array which contains founded users as object
  // 4
  await db.addLang(lang); // this function takes one argument as a language and will add this language to users informations
  // 5
  await db.deleteUser(key, value); // This function also works like select function, but this one deletes founded users from array
  // 6
  await db.rmDb(); // this function don't requires any argument. After calling this function the folder which is created by using new db() will be deleted from your project folder
})();
```

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