# json-storage-fs

> Simple key-value storage based on JSON for Node.js

Latest version **2.0.2** (published 2021-05-31) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install json-storage-fs
pnpm add json-storage-fs
yarn add json-storage-fs
bun add json-storage-fs
```

## 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 | 2.0.2 |
| Published | 2021-05-31 |
| First published | 2020-02-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Loosefer |
| Maintainers | lapkoshka |
| Keywords | key-value, storage, json |

## Links

- npm: https://www.npmjs.com/package/json-storage-fs
- Repository: https://github.com/loosefer/json-storage-fs
- Homepage: https://github.com/loosefer/json-storage-fs#readme
- Issues: https://github.com/loosefer/json-storage-fs/issues
- npm.io page: https://npm.io/package/json-storage-fs

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

- 2.0.2 (latest) — 2021-05-31
- 2.0.1 — 2021-05-31
- 2.0.0 — 2021-05-31
- 1.1.0 — 2020-03-18
- 1.0.0 — 2020-02-28

## README

# json-storage-fs - Simple key-value storage based on JSON for Node.js

[![npm package](https://nodei.co/npm/json-storage-fs.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/json-storage-fs/)

## Installation
```bash
$ npm install json-storage-fs
```

## Simple to use

json-storage-fs is a very lightweight package with no dependencies that was designed for small Node.js applications


Example:
```js
const { JsonStorage, config } = require('json-storage-fs');

// (optional set catalog path)
config({ catalog: '/tmp/meow'});

JsonStorage.set('name', 'Alice');
const name = JsonStorage.get('name');
console.log(name); // -> 'Alice'
```

## API

Get value from key
```
static get(key: string): any|undefined
```

Set value

```
static set(key: string, data: any): void
```

Delete value by key

```
static delete(key: string): void
```

Get all high-level keys

```
static getAllKeys(): string[]
```

Clear storage 

```
static clearAll(): void
```

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