# foca-cookie-storage

> Foca持久化cookie引擎

Latest version **0.0.1** (published 2022-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install foca-cookie-storage
pnpm add foca-cookie-storage
yarn add foca-cookie-storage
bun add foca-cookie-storage
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-05-27 |
| First published | 2022-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | fwh1990 |

## Links

- npm: https://www.npmjs.com/package/foca-cookie-storage
- Repository: https://github.com/foca-js/foca-cookie-storage
- Homepage: https://github.com/foca-js/foca-cookie-storage#readme
- Issues: https://github.com/foca-js/foca-cookie-storage/issues
- npm.io page: https://npm.io/package/foca-cookie-storage

## Dependencies (3)

- [cookie](https://npm.io/package/cookie.md) ^0.5.0
- [lz-string](https://npm.io/package/lz-string.md) ^1.4.4
- [@types/cookie](https://npm.io/package/@types/cookie.md) ^0.5.1

## Recent versions

- 0.0.1 (latest) — 2022-05-27

## README

# foca-cookie-storage

Foca 持久化 cookie 引擎，基于 `document.cookie` API。

[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/foca-js/foca-taro-storage/Test/master?label=test&logo=jest)](https://github.com/foca-js/foca-taro-storage/actions)
[![Codecov](https://img.shields.io/codecov/c/github/foca-js/foca-taro-storage?logo=codecov)](https://codecov.io/gh/foca-js/foca-taro-storage)
[![License](https://img.shields.io/github/license/foca-js/foca-cookie-storage?logo=open-source-initiative)](https://github.com/foca-js/foca-cookie-storage/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/v/foca-cookie-storage?logo=npm)](https://www.npmjs.com/package/foca-cookie-storage)

# 安装

```bash
yarn add foca-cookie-storage
```

# 使用

```typescript
import { store } from 'foca';
import { cookieStorage, CookieStorage } from 'foca-cookie-storage';

store.init({
  persist: [
    {
      key: 'my-project',
      version: '1',
      // 默认配置
      engine: cookieStorage,
      models: [],
    },
    {
      key: 'my-project-1',
      version: '1',
      // 自定义配置
      engine: new CookieStorage({
        // ...
      }),
      models: [],
    },
  ],
});
```

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