# all.db

> JSON Database

Latest version **0.3.2** (published 2025-04-05) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2025-04-05 |
| First published | 2024-12-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 29.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | NoNametxt |
| Maintainers | nonametxt |
| Keywords | Simple, Fast, JSON Database |

## Links

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

## 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

- 0.3.2 (latest) — 2025-04-05
- 0.3.1 — 2024-12-12
- 0.2.9 — 2024-12-12

## README

# all.db

If you found a bug contact me on [Discord](https://discord.com/users/360322989515866112).

<details><summary>Set</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

// Sets a data in the database
db.set("nonametxt.test", "all.db");
```
Output:
```json
{
  "nonametxt":{
    "test":"all.db"
  }
}
```

</details>


---

<details><summary>Get</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//Fetches you the data
db.get("nonametxt");
db.fetch("nonametxt");
```
Output:
```json
"all.db"
```
</details>


---


<details><summary>Delete</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//Deletes data
db.delete("nonametxt.test");
db.remove("nonametxt.test");
```
Output:
```json
{}
```
</details>


---


<details><summary>Add</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//If the data is a number, it adds a certain amount to data
db.add("nonametxt.number", 1);
```
Output:
```js
data + 1
```

</details>


---


<details><summary>Subtract</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//If the data is a number, it subtracts a certain amount from it
db.subtract("nonametxt.number", 1);
```
Output:
```js
data - 1
```
</details>


---


<details><summary>Push</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });
db.push("nonametxt.array", { name: "NoNametxt" });

//Pushes an element to an array
db.push("nonametxt.array", { name: "NoNametxt" }, true); //If data is not an array It will convert the data to an array
```

Output:
```json
{
  "nonametxt":{
    "array":[
      {
        "name":"NoNametxt"
      }
    ]
  }
}
```

</details>


---


<details><summary>Pull</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//Specify the object you want to delete.
db.pull("nonametxt.array", (value) => {
  try{
    return value[1].name == "NoNametxt";
  }catch(error){

  }
});
```
Output:
```json
{
  "nonametxt":{
    "array":[]
  }
}
```
</details>


---


<details><summary>Data Exists</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//Checks the data is available
db.exists("nonametxt.test");
db.has("nonametxt.test");
```
Output:
```js
true or false
```
</details>


---


<details><summary>Typeof</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//Shows the type of data
db.typeof("nonametxt.typeof"); // true or false (checks the string)

//Compares the type of data with the type you typed
db.typeof("nonametxt.typeof", "number");

```
Output:
```js
true or false
```
</details>


---

<details><summary>Math</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//If the data is a number, applies math operations to data.
db.math("nonametxt", "*", 10);

```
Output:
```js
data * 10
```
</details>


---


<details><summary>Find</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//If you have entered data, it will find and show you.
db.find("Database", true); //Searches without checking case

```
Database:
```json
{
  "string": "DATABASE",
  "otherString": "NoNametxt",
  "object": {
    "db": "database"
  },
  "array": ["database"]
}
```
Output:
```json
[
  [ "string", "DATABASE" ],
  [ "object.db", "database" ],
  [ "array.0", "database" ]
]
```
</details>

---

<details><summary>Filter</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

//If you have entered data, it will filter and show you.
db.filter(([key, value]) => {
    try {
      return value.includes("DataBase");
    } catch (error){

    };
});
```
Database:
```json
{
  "string": "DataBase",
  "otherString": "NoNametxt",
  "object": {
    "db": "DataBase"
  },
  "array": [ "DataBase" ]
}
```
Output:
```json
{ 
  "string": "DataBase",
  "array": [ "DataBase" ] 
}
```
</details>

---


<details><summary>Get All</summary>

```js
import { Database } from "all.db";
const db = new Database({ dataPath: "./data.json" });

db.getAll(); //Returns JSON Data

db.getAll().save(path); //Saves the data to the specified path
```
Output:
```
{ All Data }
```
</details>


---
Version 0.3.2 *
```diff
+ Fix push
```
---

Thx for use [all.db](https://www.npmjs.com/package/all.db).

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