react-native-localstorage v1.0.1
Manage LocalStorage items in a web environment
An online interface where you can add, edit and remove LocalStorage items. It also supports a feature where you can load your current LocalStorage items from your device.
Install
First install the package globally:
$ npm install react-native-localstorage -gInstall the package within your project:
$ npm install react-native-localstorage --saveUsage
Run the LocalStorage Debug server (Default IPV4 and port 8082):
$ react-native-localstorage start-serverOpen your index.android.js file or any other (main) file where you want to use react-native-localstorage
Import the package (also make sure you have included AsyncStorage from the react-native package):
import {setConfig} from "react-native-localstorage";Add the following (in componentWillMount):
- Change the IP address to your IPV4 address and/or change the port if you have customized it.
componentWillMount() {
setConfig(AsyncStorage, "192.168.0.130", "8082");
}Start the application and navigate to http://localhost:8082
Run the example
Start the debug server:
$ react-native-localstorage start-serverChange the ip and/or port in your index.android.js file.
componentWillMount() {
setConfig(AsyncStorage, "192.168.0.130", "8082");
}Start the application:
$ react-native run-androidRun the packager (optional in some cases):
$ npm startnavigate to http://localhost:8082
API CLI
It's a GET request by default, but can be changed in options.
react-native-localstorage start-server
Start the debug server with your IPV4 address and port 8082.
OPTION -p
Type: integer
Specify a custom port.
react-native-localstorage start-server -p 1234OPTION -i
Specify a custom ip address.
react-native-localstorage start-server -i 192.168.0.129OPTION --help
List of commands.
react-native-localstorage --helpAPI
setConfig(AsyncObject, ip, port)
Set the config so we can connect to the server.
AsyncObject
Type: object
Define your AsyncStorage object here.
ip
The ip address you want to connect with.
port
Type: integer
The port you want to connect with.
License
MIT © Arnout Quint