{"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":{"integrity":"sha512-aXPcxgh49BvAveu5PsseQn9M0Eo5/01pVm5sG7fO2kSlTcBkhbUhDmblZrqevqs93HUViRn9naUUo3bxS/3R0Q==","shasum":"e661427e269f1ac89672f293e20c523651912097","tarball":"http://registry-npm.ywwl.com/rn-host-detect/download/rn-host-detect-1.1.4.tgz","fileCount":4,"unpackedSize":5217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUzy9CRA9TVsSAnZWagAAQHkP/RikDrSFzoABbZmGDatt\n7cFFnGto89VV4bmCuMT6XBO2ndPA6/TgCnxoJ1ay0EFu47MvMvzYOJcoJPEF\nybasUUk2W0s/nwwPkMcv3qLDz9K7E7IYtp0Mysc2uc13yScj+pXHRNsGbyDA\nzX194aBSHZU2qW3rs0FMIIftLH4/lEZSmBaMlJuYwtGw4AEoXj4kn/CQpXCD\nW1rZv98RNQgg3fT+8NYvo2b48wvcD5WKaVhlCLi+/vOIQdjJdADw+QFLMuL0\nLMHJ2D0Uzb4XNAJFhzLF/soFg7tXCcl65PXkHFgblVgIHQr54KP5TKhvXNgF\neQOkoUUnpGFwqKFtINcMTPmbvIx2qNRpjgUqRNG12jX6T3cfUk5No1QFHeVE\nv/YcTvPgwo7lT5Ve2RNJlSiV0GEVB/JCZUq4q0QYb+o7YnDKIFbbeQDTUD4P\nsdzRzJo/9Grhvq1dlXl7WTwn127fOvCtVFc6ZO99De2CpLPuGQwnOv0sJvNO\nhZMOkO1a/7kv9DFeW1n1ppyDbdxj6ZZ0prd4NvIROFQq1OGVfQyLSUs4bZTq\nyVmE5lGVwiQ0N2gPIo2VM+KyeLFKTR+RquDEr2kvYabgG+26k2VT1HW0FzSJ\nGUwgbrGIm+DOVm0VyWQWqA+MmWKeo37PV55o+YI3fir78/enE1FFvy0ZQTkR\n+3+6\r\n=F2UJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkN2LKJPoLehPT91NDqtaDqpY1bvfsHOojsGY0gVR3FQIgHbT7v6Sql01KQY53Zoc1oXjR60PW6B9kHMomZsPsaHE="}],"size":2490,"noattachment":false,"key":"/rn-host-detect/-/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,"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":1532181693881,"_cnpm_publish_time":1532181693881,"dist-tags":{"latest":"1.2.0"}}