{"_id":"rn-host-detect","_rev":"307599","name":"rn-host-detect","description":"Get correctly localhost on Android emulator for React Native","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"time":{"modified":"2021-06-03T19:37:03.000Z","created":"2017-01-27T05:08:22.371Z","1.2.0":"2019-11-03T09:08:13.074Z","1.1.6":"2019-11-02T22:53:58.505Z","1.1.5":"2018-08-14T02:04:19.030Z","1.1.4":"2018-07-21T14:01:33.881Z","1.1.3":"2017-03-15T13:46:59.806Z","1.1.2":"2017-03-15T13:31:01.132Z","1.1.1":"2017-03-13T20:07:46.839Z","1.1.0":"2017-03-13T11:34:06.072Z","1.0.1":"2017-01-27T05:20:05.633Z","1.0.0":"2017-01-27T05:08:22.371Z"},"users":{},"author":{"name":"Jhen","email":"developer@jhen.me"},"repository":{"type":"git","url":"git+https://github.com/jhen0409/rn-host-detect.git"},"versions":{"1.2.0":{"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":{"shasum":"8b0396fc05631ec60c1cb8789e5070cdb04d0da0","size":2604,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/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,"publish_time":1572772093074,"_cnpm_publish_time":1572772093074},"1.1.6":{"name":"rn-host-detect","version":"1.1.6","description":"Get correctly localhost on Android emulator for React Native","scripts":{"test":"node test-055.js && node test-056.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":"b86a07ea87e9e63ca4f80d08606c4dc69cfd1f26","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.6","_nodeVersion":"12.8.1","_npmVersion":"6.10.2","dist":{"shasum":"eebb9116f48f1c94ad116fd6bdb67d815bedd679","size":2495,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/rn-host-detect-1.1.6.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.1.6_1572735238302_0.944644927449541"},"_hasShrinkwrap":false,"publish_time":1572735238505,"_cnpm_publish_time":1572735238505},"1.1.5":{"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":{"shasum":"fbecb982b73932f34529e97932b9a63e58d8deb6","size":2491,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/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,"publish_time":1534212259030,"_cnpm_publish_time":1534212259030},"1.1.4":{"name":"rn-host-detect","version":"1.1.4","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":"d220b02dd280bf92c2820a392d98e83ea50c1ea9","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.4","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"e661427e269f1ac89672f293e20c523651912097","size":2490,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/rn-host-detect-1.1.4.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rn-host-detect_1.1.4_1532181693799_0.5456211847452281"},"_hasShrinkwrap":false,"publish_time":1532181693881,"_cnpm_publish_time":1532181693881},"1.1.3":{"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","size":2332,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/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":{},"publish_time":1489585619806,"_cnpm_publish_time":1489585619806,"_hasShrinkwrap":false},"1.1.2":{"name":"rn-host-detect","version":"1.1.2","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":"c196c41d6e32e306d406ddf1910f88b7f6369b66","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.2","_shasum":"5801dbf4ab6492f911dfca401888e5610f8c147d","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"5801dbf4ab6492f911dfca401888e5610f8c147d","size":2120,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/rn-host-detect-1.1.2.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.1.2.tgz_1489584659127_0.3372686591465026"},"directories":{},"publish_time":1489584661132,"_cnpm_publish_time":1489584661132,"_hasShrinkwrap":false},"1.1.1":{"name":"rn-host-detect","version":"1.1.1","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":"4f3bb6567da152064e52b0dd2156589a3ab416f7","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.1","_shasum":"0a1c3a73641d2d97306d43697a3b4fff3a835f35","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"0a1c3a73641d2d97306d43697a3b4fff3a835f35","size":2110,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/rn-host-detect-1.1.1.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.1.1.tgz_1489435666519_0.47461086232215166"},"directories":{},"publish_time":1489435666839,"_cnpm_publish_time":1489435666839,"_hasShrinkwrap":false},"1.1.0":{"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","size":2115,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/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":{},"publish_time":1489404846072,"_cnpm_publish_time":1489404846072,"_hasShrinkwrap":false},"1.0.1":{"name":"rn-host-detect","version":"1.0.1","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","gitHead":"8a861f9d7f9c108c576183edcf5592add6c6c16e","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.1","_shasum":"fc74e91bde8646aaa6d7654373501a96ca9f70bd","_from":".","_npmVersion":"2.15.11","_nodeVersion":"0.12.18","_npmUser":{"name":"jhen0409","email":"iainst0409@gmail.com"},"dist":{"shasum":"fc74e91bde8646aaa6d7654373501a96ca9f70bd","size":1965,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/rn-host-detect-1.0.1.tgz"},"maintainers":[{"name":"jhen0409","email":"iainst0409@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rn-host-detect-1.0.1.tgz_1485494405410_0.11935170693323016"},"directories":{},"publish_time":1485494405633,"_cnpm_publish_time":1485494405633,"_hasShrinkwrap":false},"1.0.0":{"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","size":1963,"noattachment":false,"key":"/rn-host-detect/-/rn-host-detect-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rn-host-detect/download/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":{},"publish_time":1485493702371,"_cnpm_publish_time":1485493702371,"_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","_attachments":{},"homepage":"https://github.com/jhen0409/rn-host-detect#readme","bugs":{"url":"https://github.com/jhen0409/rn-host-detect/issues"},"license":"MIT"}