# @nanostores/persistent

> A store for Nano Stores state manager to keep data in localStorage

Latest version **1.3.5** (published 2026-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nanostores/persistent
pnpm add @nanostores/persistent
yarn add @nanostores/persistent
bun add @nanostores/persistent
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.5 |
| Published | 2026-07-20 |
| First published | 2021-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^20.0.0 \|\| >=22.0.0 |
| Dependencies | 0 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 383 |
| Author | Andrey Sitnik |
| Maintainers | ai |
| Keywords | cross-tab, localStorage, nano, persistent, preact, react, store, svelte, vue |

## Links

- npm: https://www.npmjs.com/package/@nanostores/persistent
- Repository: https://github.com/nanostores/persistent
- Homepage: https://github.com/nanostores/persistent#readme
- Issues: https://github.com/nanostores/persistent/issues
- Funding: https://github.com/sponsors/ai
- npm.io page: https://npm.io/package/@nanostores/persistent

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.3.5 (latest) — 2026-07-20
- 1.3.4 — 2026-04-23
- 1.3.3 — 2026-02-05
- 1.3.2 — 2026-02-05
- 1.3.1 — 2026-02-04
- 1.3.0 — 2026-01-29
- 1.2.1 — 2026-01-28
- 1.2.0 — 2025-10-20
- 1.1.0 — 2025-07-04
- 1.0.0 — 2025-04-10
- 0.10.2 — 2024-08-03
- 0.10.1 — 2024-02-21
- 0.10.0 — 2024-02-20
- 0.9.1 — 2023-07-13
- 0.9.0 — 2023-05-24
- … 20 more at https://npm.io/package/@nanostores/persistent/versions

## README

# Nano Stores Persistent

<img align="right" width="92" height="92" title="Nano Stores logo"
     src="https://nanostores.github.io/nanostores/logo.svg">

A smart store for [Nano Stores] state manager to keep data in `localStorage`
and synchronize changes between browser tabs.

* **Small.** From 296 bytes (minified and brotlied).
  Zero dependencies. It uses [Size Limit] to control size.
* It has good **TypeScript**.
* Framework agnostic. It supports SSR.
  `localStorage` can be switched to another storage.

```ts
import { persistentAtom } from '@nanostores/persistent'

export const $locale = persistentAtom('locale', 'en')
```

[Nano Stores]: https://github.com/nanostores/nanostores
[Size Limit]: https://github.com/ai/size-limit

---

<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Made at <b><a href="https://evilmartians.com/devtools?utm_source=nanostores-persistent&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.

---

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