{"name":"rn-host-detect","version":"1.0.1","description":"Get correctly localhost on Android emulator for React Native","scripts":{"test":"node test.js","prepublish":"npm test"},"main":"index.js","files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/jhen0409/rn-host-detect.git"},"author":{"name":"Jhen","email":"developer@jhen.me"},"license":"MIT","gitHead":"8a861f9d7f9c108c576183edcf5592add6c6c16e","bugs":{"url":"https://github.com/jhen0409/rn-host-detect/issues"},"homepage":"https://github.com/jhen0409/rn-host-detect#readme","_id":"rn-host-detect@1.0.1","_shasum":"fc74e91bde8646aaa6d7654373501a96ca9f70bd","_from":".","_npmVersion":"2.15.11","_nodeVersion":"0.12.18","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"fc74e91bde8646aaa6d7654373501a96ca9f70bd","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.0.1.tgz","integrity":"sha512-RULuAo28rPUGGPckae8/wVyV4CfZd5TvADgRb3HHz9TU701ucXRphlPQdPRhvxysX3ni3PpGBbU3+S7fAo2gEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFezbeNvzj07RA6QiNTYrvd0AvuXf6duBpwur8KMx+ZxAiEAjiI8zyMUnf4J2Py8aHNL5E7vh0KBysjegSp5JloN2ac="}],"size":1965,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.0.1.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.0.1.tgz_1485494405410_0.11935170693323016"},"directories":{},"readme":"# rn-host-detect\n\n> Get correctly `localhost` on Android emulator for React Native\n\nOn Android emulator, if you want to connect any servers of local, you will need run `adb reverse` on your terminal. This module made it easier, you can get the localhost IP of host machine directly (`10.0.2.2`, Genymotion: `10.0.3.2`).\n\nThis was done in the following projects:\n\n* [remote-redux-devtools](https://github.com/zalmoxisus/remote-redux-devtools/blob/fbb169173c235eceb136a02a52c6f36b64297910/src/utils/reactNative.js)\n* [reactotron-react-native](https://github.com/infinitered/reactotron/blob/f5de09955b870a90cc772bf6c5139ef8e3ecbbba/packages/reactotron-react-native/src/get-host.js)\n\nThat's why you don't need `adb reverse` when you're using these modules on Android emulator.\n\n## Installation\n\n```bash\n$ npm i rn-host-detect --save-dev\n```\n\n## Usage\n\n```js\nconst getHostForRN = require('rn-host-detect')\n\n// '10.0.2.2' or '10.0.3.2' on Android\ngetHostForRN('localhost')\n\n// '192.168.1.111', only convert localhost (or 127.0.0.1) to host IP\ngetHostForRN('192.168.1.111')\n```\n\n## License\n\n[MIT](LICENSE.md)\n","publish_time":1485494405633,"_cnpm_publish_time":1485494405633,"dist-tags":{"latest":"1.2.0"}}