{"name":"rn-host-detect","version":"1.1.5","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":"f57206396e65e9b7d8dfce1f783f37e4a64a7fd6","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.5","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"integrity":"sha512-ufk2dFT3QeP9HyZ/xTuMtW27KnFy815CYitJMqQm+pgG3ZAtHBsrU8nXizNKkqXGy3bQmhEoloVbrfbvMJMqkg==","shasum":"fbecb982b73932f34529e97932b9a63e58d8deb6","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.1.5.tgz","fileCount":4,"unpackedSize":5210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcjijCRA9TVsSAnZWagAAUFUP/iYQKsIyh3H74c4AuiP1\nOaWJQe41Huhb5pRQQJAAUi1MBb7PlWSF4myfL1S+7gX1kjq1fmRTVGhkSAmQ\n8F9VzUjwwLxUVfZwOml9Od+Y1Dh0LFt/wWu4n4KQOHKusQ4IjNQr3dncdpuc\nx3Et9HrhayMfo94N5/YTay0eBQVuLiSG/lgw27HSh9zBo4Mfl5/5FhBRRNB7\n89VrlegPt7ONxUngtmDWZrHvLjD61faGH3wrnlAaA/Zc5ZZslXh0idPnDD9c\nkhJbCcHJ1o278a3bZXgyJLZP4rTcHZ14tzLcMh0pXkhAgt4yReoGNkVcqOLd\nDeO0fFHRpYEuMzmy84vZUTlqsA0MNeYGilahQUN+BYx0AdAXiux+QahDbvQl\n3ncgzF95kAH+sCBE4J3Ajrzd3ncKWOW0Lb4qWDMdfhbV766KZL/Tf+O2R1fQ\n9oDGBHN9xkzEfilBTmzciAAiljk4d2g1kp0SWTHnbBCncIgDgM/2kOfzPubV\ncEzgSaJEbsbSFDe7dWp3ecnBNX8WxBk/GR3yiRXigwDwsI0bTPAX4iMzpwoR\n3QBEY2GBkZkl3cmCczIMaWP1y/NPoLsQJnP+GSbWNBDIZNVA2v1y397zdJxR\nyDn2vCC8MuLUkWBkgDatCOXqqIViIz/ZzHS5uEld66Cqp9nHyBR8gfGLQywJ\nQeyH\r\n=z2FQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBud7C+VxmUDMRVL54babJWfqyC0opL62lAyXG51A9ETAiAX/OB2LpoIdIiE3slGDOWmDUB62zsR7xsBb4Pv2L6b/w=="}],"size":2491,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.5.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rn-host-detect_1.1.5_1534212258948_0.418593228199698"},"_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":1534212259030,"_cnpm_publish_time":1534212259030,"dist-tags":{"latest":"1.2.0"}}