# @joshdb/json

> JSON Provider for JOSH

Latest version **1.0.5** (published 2021-12-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @joshdb/json
pnpm add @joshdb/json
yarn add @joshdb/json
bun add @joshdb/json
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-12-24 |
| First published | 2021-01-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 72 |
| Author | Evelyne Lachance |
| Maintainers | eslachance |

## Links

- npm: https://www.npmjs.com/package/@joshdb/json
- Repository: https://github.com/eslachance/josh
- Homepage: https://github.com/eslachance/josh#readme
- Issues: https://github.com/eslachance/josh/issues
- npm.io page: https://npm.io/package/@joshdb/json

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [on-change](https://npm.io/package/on-change.md) ^2.2.2
- [atomically](https://npm.io/package/atomically.md) ^1.7.0
- [serialize-javascript](https://npm.io/package/serialize-javascript.md) ^5.0.1

## Recent versions

- 1.0.5 (latest) — 2021-12-24
- 3.0.0-next.8799c4a.0 (next) — 2025-11-02
- 3.0.0-next.b080164.0 — 2025-09-14
- 3.0.0-next.ba734aa.0 — 2025-09-07
- 3.0.0-next.6766723.0 — 2025-09-07
- 3.0.0-next.3b4d984.0 — 2025-09-07
- 3.0.0-next.ac86f9a.0 — 2025-08-31
- 3.0.0-next.0a154dd.0 — 2025-01-12
- 3.0.0-next.71f3b62.0 — 2025-01-12
- 3.0.0-next.4b1f96e.0 — 2024-11-03
- 3.0.0-next.829eea5.0 — 2024-11-03
- 3.0.0-next.b8543c0.0 — 2024-11-03
- 3.0.0-next.0a7d2a7.0 — 2024-10-27
- 3.0.0-next.d685c59.0 — 2024-10-27
- 3.0.0-next.214f98c.0 — 2024-10-27
- … 334 more at https://npm.io/package/@joshdb/json/versions

## README

# JSON Provider for JOSH

The JSON provider uses the `atomically` module for persistent storage of JOSH data.

### Running the installer

In your project folder, you should be able to install using this command:

```
npm i @joshdb/json
** OR **
yarn add @joshdb/json
```

## Usage

Using the JSON provider goes as such:

```js
const Josh = require('@joshdb/core');
const JoshJSON = require('@joshdb/json');

const db = new Josh({
  name: 'testing',
  provider: JoshJSON,
  // See below for all provider options.
  providerOptions: {},
});

db.defer.then(async () => {
  console.log(`Connected, there are ${await db.size} rows in the database.`);
});
```

## Provider Options

Here is a list of full options this provider supports:

| Param                          | Type                 | Description                                                            |
| ------------------------------ | -------------------- | ---------------------------------------------------------------------- |
| [providerOptions]              | <code>Object</code>  | The Provider Options Object, with the below properties:                |
| [providerOptions.maxLength]    | <code>string</code>  | Optional, defaults to `100`. The amount of entries per json chunk file |
| [providerOptions.dataDir]      | <code>string</code>  | Optional, defaults to `data`. The location for the stored json files   |
| [providerOptions.indexAll]     | <code>boolean</code> | Optional, defaults to `false`. Adds new keys from the stored json files |
| [providerOptions.cleanupEmpty] | <code>boolean</code> | Optional, defaults to `false`. Cleans out empty keys from index file   |

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