# x-json-storage

> to storage json data use localStorage or sessionStorage

Latest version **1.0.2** (published 2021-07-19) · MIT license · 0 weekly downloads

## Install

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

## 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.0.2 |
| Published | 2021-07-19 |
| First published | 2021-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | xwinstone |
| Maintainers | xwinstone |
| Keywords | json-storage |

## Links

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

## 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.2 (latest) — 2021-07-19
- 1.0.1 — 2021-07-19
- 1.0.0 — 2021-07-19

## README

# json-storage
storage json data using localStorage or sessionStorage for daily usage.

## Usage
### import from npm
```shell script
npm i x-json-storage
```

### example

```js
// use localStorage

import jsonStorage from "x-json-storage";

const data = {
  name: 'xwinstone'
}
// set data
jsonStorage.setItem('info', data)
// get data
jsonStorage.getItem('info') // {name: 'xwinstone'}
// remove 
jsonStorage.remove('info')
```

```js
// to use sessionStorage, please set the last parameter to true
import jsonStorage from "x-json-storage";

const data = {
  name: 'xwinstone'
}
// set data
jsonStorage.setItem('info', data, true)
// get data
jsonStorage.getItem('info', true) // {name: 'xwinstone'}
// remove 
jsonStorage.remove('info', true)
```

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