{"name":"rn-host-detect","version":"1.0.0","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","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.0","_shasum":"4460c27055970df7fee29cc1868ad50ac098e161","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"4460c27055970df7fee29cc1868ad50ac098e161","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.0.0.tgz","integrity":"sha512-TsPlKlMi8CekOs+fCOK6whrELKSupC8dRnCYVO10ohe98wTczOWqJ+Mq3FNzXU+g3e59kRYu019hNPRHY7NoKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIArCTcM6Zcy/TOi74KRuFF4g+ZEXO1DqXg1zFFfQk2hJAiEA/LNPuQ9JJQoLPn2UgRI/qhpX4HNkDGpIlxUGMXh79vE="}],"size":1963,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.0.0.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.0.0.tgz_1485493700433_0.24394242838025093"},"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":1485493702371,"_cnpm_publish_time":1485493702371,"dist-tags":{"latest":"1.2.0"}}