# pinia-persist-plugin

> Opinionated persist plugin for pinia@next

Latest version **1.0.3** (published 2022-01-04) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install pinia-persist-plugin
pnpm add pinia-persist-plugin
yarn add pinia-persist-plugin
bun add pinia-persist-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-01-04 |
| First published | 2021-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | guygubaby |
| Maintainers | guygubaby |

## Links

- npm: https://www.npmjs.com/package/pinia-persist-plugin
- Repository: https://github.com/guygubaby/pinia-persist-plugin
- Homepage: https://github.com/guygubaby/pinia-persist-plugin#readme
- Issues: https://github.com/guygubaby/pinia-persist-plugin/issues
- Funding: https://github.com/sponsors/guygubaby
- npm.io page: https://npm.io/package/pinia-persist-plugin

## Recent versions

- 1.0.3 (latest) — 2022-01-04
- 1.0.2 — 2022-01-04
- 1.0.1 — 2021-12-01
- 1.0.0 — 2021-11-30
- 0.1.2 — 2021-11-25
- 0.1.1 — 2021-09-19
- 0.1.0 — 2021-09-19

## README

# pinia-persist-plugin

## Opinionated persist plugin for [pinia@next](https://pinia.esm.dev/)

[![NPM version](https://img.shields.io/npm/v/pinia-persist-plugin?color=a1b858&label=)](https://www.npmjs.com/package/pinia-persist-plugin)

## Get Started

```bash
pnpm i pinia-persist-plugin
```

## Usage

```typescript
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createPersistPlugin } from 'pinia-persist-plugin'

const pinia = createPinia()
const plugin = createPersistPlugin()
pinia.use(plugin)

const app = createApp(App)
app.use(pinia)
```

## Configuration Options

```typescript
interface Options {
  storage?: Storage // where to store the persistent
  storageKey?: string // which key to persist the store state
  omits?: string[] | string // store id[s] to omit persist
}

// The default config is here
const defaultOptions: Required<Options> = {
  storage: window.sessionStorage,
  storageKey: 'pinia-persist-plugin-state',
  omits: []
}

const plugin = createPersistPlugin(options?: Options)
```

## Example

Can be accessed from [playground](https://github.com/guygubaby/pinia-persist-plugin/tree/main/playground) folder

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