{"name":"rn-host-detect","version":"1.2.0","description":"Get correctly localhost on Android emulator for React Native","scripts":{"test":"node test-require-polyfill.js && node test-no-require-polyfill.js","prepublish":"npm test"},"main":"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":"99bdee6f4092a3e4e690f9c1fd8f5b9c8a8da6a9","bugs":{"url":"https://github.com/jhen0409/rn-host-detect/issues"},"homepage":"https://github.com/jhen0409/rn-host-detect#readme","_id":"rn-host-detect@1.2.0","_nodeVersion":"12.8.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-btNg5kzHcjZZ7t7mvvV/4wNJ9e3MPgrWivkRgWURzXL0JJ0pwWlU4zrbmdlz3HHzHOxhBhHB4D+/dbMFfu4/4A==","shasum":"8b0396fc05631ec60c1cb8789e5070cdb04d0da0","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.2.0.tgz","fileCount":4,"unpackedSize":5642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvpj9CRA9TVsSAnZWagAAilIP/RDc25nvm+mbrYmoatHU\nNCIIIvSMVtRXOpwZ8Cpow4APuin9RPbkalG7rEdDQe5Ppl8T68YXzQYYtpWD\n/rTIAlfp2z0NAckm2ubEFS+jVdqah9aQa6KchnM+H0ajc/82mMPJUJuE/7iM\n043g31jE0eKPttse4yYEeUuSKkgsrSD9MzDGViNCAfEsp1Dy5k5KYoHTQE9r\nbe+HaSomCw+UnHuE7zOzSdvvXAdJAaXBBE3qdEdUzHpk8leQDuUaqcsxMu0i\n2ocPbvk7vCCyQT4txJNhLZdVtk7gXrchQPD0i5PKqVFTkXCzzrSsoaZsKEfA\neetQSRgPau938blfuX5roX2lZf8tuAZklD0PELyZ741XSI9sSHa+STR9pIkv\ny8297IUx7cDq/euyzGvvXlKlzx56ffLoxVI45a1oog6XSw5Vn1cVsJmnsfSu\nlgj7HH1OHK9Lt3G0r2I6E+GxR2NpycumWT8oHhRB/scemHeWcbnhmlyz6kOt\nkBnnteRMp+AOw8E1sicKh/06PmRZKfZMCjZ1B85cBoeRVPvaJJM3z5oWinuk\nkrxPUDK5l6I+yDkwhGYe3+YhQbbhFCboVUP8M8Y21dR2/vrWVOvSojvHXhFG\nrGVp3Lbu3IfN2klPqmv6+q58Ir/VX/EUcdAULi8Emb3D3xTmtqYoU3v3ZwxA\n4xGl\r\n=qWKn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2Ijx4HQVX0FqrZ7+sSh9gDW0ZUaHAVQ1Oqwu6W271xQIgchJLsZRqwNz2V0PcR/NO9elaVUphZkxvMLYO9N1VVgw="}],"size":2604,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.2.0.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rn-host-detect_1.2.0_1572772092906_0.9329520198004475"},"_hasShrinkwrap":false,"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":1572772093074,"_cnpm_publish_time":1572772093074,"dist-tags":{"latest":"1.2.0"}}