New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-native-community/async-storage

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/async-storage

Asynchronous, persistent, key-value storage system for React Native.

  • 1.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77K
decreased by-15.11%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Async Storage

An asynchronous, unencrypted, persistent, key-value storage system for React Native.

Getting Started

# Install
$ yarn add @react-native-community/async-storage

# Link
$ react-native link @react-native-community/async-storage

See docs for manual linking guide.

Note: For iOS project using pods, run: $ cd ios/ && pod install

Usage

Import

import AsyncStorage from '@react-native-community/async-storage';

Store data


storeData = async () => {
  try {
    await AsyncStorage.setItem('@storage_Key', 'stored value')
  } catch (e) {
    // saving error
  }
}

Read data


getData = async () => {
  try {
    const value = await AsyncStorage.getItem('@storage_Key')
    if(value !== null) {
      // value previously stored
    }
  } catch(e) {
    // error reading value
  }
}

Advanced

See docs for api and more examples or advanced usages.

Writing tests

Using Jest for testing? Make sure to check out docs on how to integrate it with this module.

Contribution

See the CONTRIBUTING file for how to help out.

License

MIT

Keywords

FAQs

Package last updated on 14 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc