{"name":"rn-host-detect","version":"1.1.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","devDependencies":{"sinon":"^1.17.7"},"gitHead":"02c84b8aa95d36f42c8f14697c021c16bc0b2550","bugs":{"url":"https://github.com/jhen0409/rn-host-detect/issues"},"homepage":"https://github.com/jhen0409/rn-host-detect#readme","_id":"rn-host-detect@1.1.0","_shasum":"bbda97ff96ac6bd94e63fac0adbd3f689c12987a","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"bbda97ff96ac6bd94e63fac0adbd3f689c12987a","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.1.0.tgz","integrity":"sha512-v2CeyVaeK3iVMz0nwazEOaW9eBI5sXIBOJ91pACmRheo1LTkhzVKRgxVJPHlUCTEdpYWm39AGOAoLYb9u/xoEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhzr9No67jEHZGw6fMbeJUJWP8XpPMZkGhj+eZdrqm+AiAcPXN44d8RTi0r2PM9ybd5TC/DRVss6bPjudIO/ApmPQ=="}],"size":2115,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.0.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.1.0.tgz_1489404845795_0.05083280405960977"},"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":1489404846072,"_cnpm_publish_time":1489404846072,"dist-tags":{"latest":"1.2.0"}}