# ez-json-store

> Store and retrieve JSON from a file.

Latest version **1.0.0** (published 2016-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install ez-json-store
pnpm add ez-json-store
yarn add ez-json-store
bun add ez-json-store
```

## 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.0 |
| Published | 2016-12-01 |
| First published | 2016-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tom Alcorn |
| Maintainers | alcorn |
| Keywords | json, store |

## Links

- npm: https://www.npmjs.com/package/ez-json-store
- Repository: https://github.com/tdb-alcorn/ez-json-store
- Homepage: https://github.com/tdb-alcorn/ez-json-store#readme
- Issues: https://github.com/tdb-alcorn/ez-json-store/issues
- npm.io page: https://npm.io/package/ez-json-store

## 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.0.0 (latest) — 2016-12-01

## README

# ez-json-store

A simple JSON storage utility that calls Node's `fs` module.

## Example

```
var path = require("path");
var JSONStore = require("ez-json-store").JSONStore;

var shopping = {
    "milk": "1/2 gallon",
    "avocados": 3,
};

var s = new JSONStore(path.resolve("shopping.json"));
s.store(shopping)
.then(console.log);

/* ... */

s.retrieve()
.then(console.log);
```

## Methods

- `#store(contents) -> Promise(contents)`: JSON stringifies contents and then stores them at the
  given path.
- `#retrieve() -> Promise(contents)`: Retrieves whatever you stored and JSON parses it.
- `#destroy() -> Promise()`: Deletes the store file.

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