# @callstack/async-storage

> Cross platform storage for React Native and Web, built on top of React Native

Latest version **2.0.3** (published 2019-07-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @callstack/async-storage
pnpm add @callstack/async-storage
yarn add @callstack/async-storage
bun add @callstack/async-storage
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2019-07-09 |
| First published | 2016-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 109 |
| Author | Mike Grabowski |
| Maintainers | grabbou, lukewalczak, souhe |

## Links

- npm: https://www.npmjs.com/package/@callstack/async-storage
- Repository: https://github.com/callstack-io/react-native-cross-platform-storage
- Homepage: https://github.com/callstack-io/react-native-cross-platform-storage#readme
- Issues: https://github.com/callstack-io/react-native-cross-platform-storage/issues
- npm.io page: https://npm.io/package/@callstack/async-storage

## Dependencies (1)

- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.0

## Recent versions

- 2.0.3 (latest) — 2019-07-09
- 1.1.0 — 2017-10-05
- 1.0.1 — 2017-10-02
- 1.0.0 — 2016-12-13

## README

[![Version][version-badge]][package]
[![Build Status][build-badge]][build]

@callstack/async-storage
==================================

> Cross platform local storage with React Native - like API.


Check out working [web example](https://codesandbox.io/s/r9l9ljr04) 💻 and [mobile](https://snack.expo.io/@happiryu/@callstack-async-storage-example) 📱

In order to use it, just import from either web or native:

```js
import AsyncStorage from '@callstack/async-storage';
```

and call any of the methods available [here](https://facebook.github.io/react-native/docs/asyncstorage.html). The API is 100% compatible,
including the errors that can be thrown.

```js
AsyncStorage.setItem('key', 'value')
  .then(() => {})
  .catch(() => {})
```

~**Warning:** Unlike React Native AsyncStorage, this module doesn't accept callbacks. If you are already using Promises or async/await, this warning can be ignored.~

Sice the version 1.1.0 we do support **callbacks** (along with promises) for methods `setItem`, `getItem`, `removeItem` and `getAllKeys`. That's mean that this library now plays well with e.g. [redux-persist](https://github.com/rt2zz/redux-persist). :rocket:

<!-- badges -->
[version-badge]: https://img.shields.io/npm/v/@callstack/async-storage.svg?style=flat-square
[package]: https://www.npmjs.com/package/@callstack/async-storage
[build-badge]: https://img.shields.io/circleci/project/github/callstack/async-storage/master.svg?style=flat-square
[build]: https://circleci.com/gh/callstack-io/async-storage

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