# justdata

> a JSON/YAML/LocalStorage database module

Latest version **1.4.0** (published 2023-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install justdata
pnpm add justdata
yarn add justdata
bun add justdata
```

## 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 | 1.4.0 |
| Published | 2023-01-05 |
| First published | 2023-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | justmoon01 |
| Maintainers | justmoon01, manydev |
| Keywords | just, just-api, justapi, justdb, just-db, justdata, json, jsondb, yaml, yamldb, local, localstorage, local storage, node-json-db, db, database |

## Links

- npm: https://www.npmjs.com/package/justdata
- Homepage: https://discord.gg/5txKMc3Wuy
- Issues: https://discord.gg/5txKMc3Wuy
- npm.io page: https://npm.io/package/justdata

## 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.4.0 (latest) — 2023-01-05
- 1.3.0 — 2023-01-04
- 1.2.5 — 2023-01-04
- 1.2.0 — 2023-01-04
- 1.1.0 — 2023-01-04
- 1.0.5 — 2023-01-04
- 1.0.0 — 2023-01-04

## README

<div align="center">
	<p>
		<a href="https://discord.gg/U4ZBepY5ea"><img src="https://img.shields.io/discord/937061965468160010?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
		<a href="https://www.npmjs.com/package/justdata"><img src="https://img.shields.io/npm/v/justdata.svg?maxAge=3600" alt="npm version" /></a>
		<a href="https://www.npmjs.com/package/justdata"><img src="https://img.shields.io/npm/dt/justdata.svg?maxAge=3600" alt="npm downloads" /></a>
	</p>
</div>



# JustData

> a JSON database module

Examples

> Moving Data From Quick.DB

```js
const data = require("justdata");
const quickdb = require("quick.db");

data.move(quickdb)
```

> Normal Example

```js
const data = require("justdata")

data.set("x.y.z", "abc") // abc

data.get("x") // {y: {z: "abc"}}
data.fetch("x") // {y: {z: "abc"}}
data.all() // {x: {y: {z: "abc"}}}

data.push("a", "hello") //  ["hello"]
data.push("a", "world") //  ["hello", "world"]
data.unpush("a", "hello") // ["world"]

data.push("b", {test: "justdata"}) // [{test: "justdata"}]
data.push("b", {test2: "justdata2"}) // [{test: "justdata"}, {test2: "justdata2"}]
data.delByPriority("b", 1) // [{test2: "justdata"}]
data.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}]

data.has("x") // true
data.delete("x") // true
data.deleteAll() // true
```

> With Options Example

```js
const data = require("justdata")

data.setReadable(true) // It makes readable your JSON DB file.

data.noBlankData(true) // If you delete anything from object and new object size is less than 1, automaticly removes that object.

data.setAdapter("yamldb") // It makes adapter as written adapter. Default adapter is JsonDB

data.set("x.y.z", "abc") // abc

data.get("x") // {y: {z: "abc"}}
data.fetch("x") // {y: {z: "abc"}}
data.all() // {x: {y: {z: "abc"}}}

data.push("a", "hello") //  ["hello"]
data.push("a", "world") //  ["hello", "world"]
data.unpush("a", "hello") // ["world"]

data.push("b", {test: "justdata"}) // [{test: "justdata"}]
data.push("b", {test2: "justdata2"}) // [{test: "justdata"}, {test2: "justdata2"}]
data.delByPriority("b", 1) // [{test2: "justdata"}]
data.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}]

data.has("x") // true
data.delete("x") // true
data.deleteAll() // true
```

If you've any question, you can join to my Discord server: [Click me!](https://discord.gg/5txKMc3Wuy)

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