{"name":"rn-host-detect","version":"1.1.3","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":"0e51bcede16216aebc262bf08df03187936f5767","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.3","_shasum":"242d76e2fa485c48d751416e65b7cce596969e91","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"242d76e2fa485c48d751416e65b7cce596969e91","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.1.3.tgz","integrity":"sha512-m3scRpqBVGfMtY6J6ch6GYeCNoqWQLljWXleoMumcT+fTiYwsgEVHekiwBu2SQ+j3CS80DKbjcyC68bQLlMmvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICd4pODeROMVBUzqnGXT4Pw2HUdFrj/KM1NBdts4RvXTAiEAtY5Bbyya9DvD3rS/f5sfJF8kc5xlYsg7iHDGdzxjU1Y="}],"size":2332,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.3.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.1.3.tgz_1489585618015_0.37891966034658253"},"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":1489585619806,"_cnpm_publish_time":1489585619806,"dist-tags":{"latest":"1.2.0"}}