{"name":"in-gfw","version":"1.2.0","description":"Identify current location is located in mainland China.","main":"lib/index.js","nyc":{"require":["@babel/register"],"reporter":["lcov","text-summary"],"cache":true},"babel":{"presets":[["@babel/env"]],"plugins":["@babel/transform-runtime"]},"scripts":{"report-coverage":"codecov","pretest":"eslint lib test","test":"node . && nyc mocha --no-timeouts"},"repository":{"type":"git","url":"git+https://github.com/gucong3000/in-gfw.git"},"keywords":["OS","system","location","geo","PRC","mainland","China","gfw","Great","Firewall"],"author":{"name":"gucong3000"},"license":"MIT","bugs":{"url":"https://github.com/gucong3000/in-gfw/issues"},"homepage":"https://github.com/gucong3000/in-gfw#readme","devDependencies":{"@babel/core":"^7.0.0-beta.51","@babel/plugin-transform-runtime":"^7.0.0-beta.51","@babel/preset-env":"^7.0.0-beta.51","@babel/register":"^7.0.0-beta.51","@babel/runtime":"^7.0.0-beta.51","ci-info":"^1.1.3","codecov":"^3.0.2","eslint":"^5.0.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.13.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-standard":"^3.1.0","mocha":"^5.2.0","mock-fs":"^4.5.0","nyc":"^12.0.2","proxyquire":"^2.0.1","util-promisify":"^2.1.0"},"dependencies":{"glob":"^7.1.2","is-wsl":"^1.1.0","mem":"^3.0.1"},"gitHead":"0dd423f76a2ca4089661152c22d17ab78fb0d73b","_id":"in-gfw@1.2.0","_npmVersion":"6.1.0","_nodeVersion":"8.11.3","_npmUser":{"name":"gucong","email":"gucong@gmail.com"},"dist":{"integrity":"sha512-LgSoQXzuSS/x/nh0eIggq7PsI7gs/sQdXNEolRmHaFUj6YMFmPO1kxQ7XpcT3nPpC3DMwYiJmgnluqJmFXYiMg==","shasum":"95b419a89cb0319db412fae353883c3b9ac177d7","tarball":"http://registry-npm.ywwl.com/in-gfw/download/in-gfw-1.2.0.tgz","fileCount":8,"unpackedSize":15073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPHHlCRA9TVsSAnZWagAASRkP/0Kozw5CLyyGWqjPSoH2\nnFMky3RSh9DDUSLLgwMzeoGGcbZ5QWi0MV1d5ZO2z95zuZ34+Ua2U5pW0+LM\nYo5vqgLyAhFQaCsGYfXquUe2ripzkkF7z7NQ63ntoPfaHKLbCRj92gL+vwan\nQjy5tnz9LrGevhsvNjh5SflqSpdp6Hpekfn4iGnWz4w3j1cDiKS84zBqnKdz\nEzhmgbPVEmtlCyc4rWPPZdx9JDnWuEkgeAFlkPdsM7Dxw46mVOOoI9jEfNSR\nlNgRGMvKRuikCon9Q8jcp19qy2RQFzLg/CduO5SO2TBbnYD4THHjIxvQirxU\nX5pEdjYXCQItOziNAp/mtT9aB8qh0iThTrgNr+8VGr69xtCPalo+nyXpcRun\n1Xdj3vWCpCbcTdzizUgmk99fFJfvGUKfKDP3UqrsOdZqmCi2xS7j3OMs+P57\nJAHA0ODmfOgoCxSEYS8ZfOVoz2Q9SvXnxeDZWvcLLzmagAw+QKLwHvZMDGXp\n+wDvj9Kd8/Qe+BJZQgcIhn0wYzKxGumA7QztyFEd9PceW+vwXRnKj9fXJ1gW\ntJdReVXzkf66oka1SrJQpb+GK2ywDeyNQSzUzPitVUP87QveLycpmW4okYFF\nD4Fghp7YcefeFP6kqIpsc4nYG8ODq7SE/CX+QDfBHAZYQZF13rNmfGXdKBQk\n2BU7\r\n=5Nzc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrh2Se8KA7G9As81ry5WqOP24Hq1c9SDlL5bAb5wKZcAIge2NWmz7txq2JZ57cXpY2Klf54OeG52aYb6mcPOD/H74="}],"size":5433,"noattachment":false,"key":"/in-gfw/-/in-gfw-1.2.0.tgz"},"maintainers":[{"name":"gucong","email":"gucong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/in-gfw_1.2.0_1530687973440_0.15247773583581115"},"_hasShrinkwrap":false,"readme":"in-gfw\r\n=====\r\n[![NPM version](https://img.shields.io/npm/v/in-gfw.svg?style=flat-square)](https://www.npmjs.com/package/in-gfw)\r\n[![Travis](https://img.shields.io/travis/gucong3000/in-gfw.svg?&label=Linux)](https://travis-ci.org/gucong3000/in-gfw)\r\n[![AppVeyor](https://img.shields.io/appveyor/ci/gucong3000/in-gfw.svg?&label=Windows)](https://ci.appveyor.com/project/gucong3000/in-gfw)\r\n[![Codecov](https://img.shields.io/codecov/c/github/gucong3000/in-gfw.svg)](https://codecov.io/gh/gucong3000/in-gfw)\r\n[![David](https://img.shields.io/david/gucong3000/in-gfw.svg)](https://david-dm.org/gucong3000/in-gfw)\r\n\r\nIdentify if current location is located in mainland China.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install in-gfw\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nconst inGFW = require(\"in-gfw\");\r\ninGFW().then(console.log);\t// `true` for located in mainland China\r\ninGFW.os().then(console.log);\t// `true` for system located in mainland China\r\ninGFW.net().then(console.log);\t// `true` for network located in mainland China\r\n```\r\n\r\n## API\r\n\r\n```js\r\ninGFW(blockedHost, cnHost);\r\ninGFW.sync(blockedHost, cnHost);\t// Synchronous version of `inGFW()`\r\n```\r\nGet result by `inGFW.os()` and fallback to `inGFW.net()`\r\n\r\n```js\r\ninGFW.os();\r\ninGFW.osSync();\t// Synchronous version of `inGFW.os()`\r\n```\r\n\r\n- Windows: Check if current location settings is `PRC`.\r\n  > Control Panel: Regional and language -> Location\r\n- POSIX systems: Check if [timezone](https://en.wikibooks.org/wiki/Puredyne/Date_and_Timezone) is set to `Beijing`, `Chongqing`, `Shanghai`, `Urumqi` or `PRC`.\r\n\r\n```js\r\ninGFW.net(blockedHost, cnHost);\r\ninGFW.netSync(blockedHost, cnHost);\t// Synchronous version of `inGFW.net()`\r\n```\r\nBased on the speed of network access to identify if current location is located in mainland China.\r\n\r\n- `blockedHost`\r\n\r\n  Type: `string|URL`\r\n\r\n  Default: `\"www.npmjs.com\"`\r\n\r\n  host for speed test that blocked by GFW\r\n\r\n- `cnHost`\r\n\r\n  Type: `string|URL`\r\n\r\n  Default: `\"npm.taobao.org\"`\r\n\r\n  host for speed test that mirrored in mainland China.\r\n","publish_time":1530687973501,"_cnpm_publish_time":1530687973501,"dist-tags":{"latest":"1.2.0"}}