# @syrflover/simple-store

> [![Build Status](https://travis-ci.org/syrflover/simply-store.png?branch=master)](https://travis-ci.org/syrflover/simply-store)

Latest version **0.0.10** (published 2019-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @syrflover/simple-store
pnpm add @syrflover/simple-store
yarn add @syrflover/simple-store
bun add @syrflover/simple-store
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2019-07-15 |
| First published | 2019-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | syrflover |
| Maintainers | syrflover |

## Links

- npm: https://www.npmjs.com/package/@syrflover/simple-store
- Repository: https://github.com/syrflover/command-parser
- Homepage: https://github.com/syrflover/command-parser#readme
- Issues: https://github.com/syrflover/command-parser/issues
- npm.io page: https://npm.io/package/@syrflover/simple-store

## Recent versions

- 0.0.10 (latest) — 2019-07-15
- 0.0.9 — 2019-07-15

## README

# simply-store

[![Build Status](https://travis-ci.org/syrflover/simply-store.png?branch=master)](https://travis-ci.org/syrflover/simply-store)

## Installation

```sh
npm install @syrflover/simple-store
```

## Usage

```ts
import { createStore } from '@syrflover/simple-store';

const store = createStore('./store.json');
// or use generic
const store = createStore<SomeObjectType>('./store.json');

store
    .initialize({ init: 'init' }) // if not exists store file, initialize store with init value
    .then(async () => {
        const read0 = await store.read();
        // { init: 'init' }

        // overwrite the store
        await store.write({ user: [{ id: 1, name: 'syr' }] });

        const read1 = await store.read();
        // { user: [{ id: 1, name: 'syr' }] }

        // overwrite the store
        await store.write({ post: [{ id: 1, content: 'content' }] });

        const read2 = await store.read();
        // { post: [{ id: 1, content: 'content' }] }
    })
    .catch(() => {
        // some error handle
    });
```

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