{"_id":"in-gfw","_rev":"497423","name":"in-gfw","description":"Identify current location is located in mainland China.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"gucong","email":"gucong@gmail.com"}],"time":{"modified":"2021-08-09T08:00:23.000Z","created":"2018-04-02T10:51:58.512Z","1.2.0":"2018-07-04T07:06:13.501Z","1.1.2":"2018-06-07T05:13:00.492Z","1.1.1":"2018-05-08T03:35:48.588Z","1.1.0":"2018-05-02T02:58:42.801Z","1.0.0":"2018-04-02T10:51:58.512Z"},"users":{},"author":{"name":"gucong3000"},"repository":{"type":"git","url":"git+https://github.com/gucong3000/in-gfw.git"},"versions":{"1.2.0":{"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":{"shasum":"95b419a89cb0319db412fae353883c3b9ac177d7","size":5433,"noattachment":false,"key":"/in-gfw/-/in-gfw-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/in-gfw/download/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,"publish_time":1530687973501,"_cnpm_publish_time":1530687973501},"1.1.2":{"name":"in-gfw","version":"1.1.2","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":[["env"]],"plugins":["transform-runtime"]},"scripts":{"report-coverage":"codecov","pretest":"eslint *.js 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-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.7.0","babel-register":"^6.26.0","babel-runtime":"^6.26.0","ci-info":"^1.1.3","codecov":"^3.0.2","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.12.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.0"},"gitHead":"8e96731cdae3a6eba9a333c886ca1d5689fbdddf","_id":"in-gfw@1.1.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"gucong","email":"gucong@gmail.com"},"dist":{"shasum":"02f80ff28b611ae6c30dc1d1f47a5b579c7d09fb","size":4984,"noattachment":false,"key":"/in-gfw/-/in-gfw-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/in-gfw/download/in-gfw-1.1.2.tgz"},"maintainers":[{"name":"gucong","email":"gucong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/in-gfw_1.1.2_1528348380422_0.26875253866438764"},"_hasShrinkwrap":false,"publish_time":1528348380492,"_cnpm_publish_time":1528348380492},"1.1.1":{"name":"in-gfw","version":"1.1.1","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":[["env"]],"plugins":["transform-runtime"]},"scripts":{"report-coverage":"codecov","pretest":"eslint *.js 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-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","babel-runtime":"^6.26.0","ci-info":"^1.1.3","codecov":"^3.0.1","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.1.0","mocha":"^5.1.1","mock-fs":"^4.5.0","nyc":"^11.7.1","proxyquire":"^2.0.1","util-promisify":"^2.1.0"},"dependencies":{"glob":"^7.1.2","is-wsl":"^1.1.0","mem":"^3.0.0"},"gitHead":"eda74a402c1c14f4b96460b59abd93ed52ea7f14","_id":"in-gfw@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"gucong","email":"gucong@gmail.com"},"dist":{"shasum":"48c87587655bd55b04aed9e47e7fbf49529ec8c4","size":4731,"noattachment":false,"key":"/in-gfw/-/in-gfw-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/in-gfw/download/in-gfw-1.1.1.tgz"},"maintainers":[{"name":"gucong","email":"gucong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/in-gfw_1.1.1_1525750548437_0.8358863120339017"},"_hasShrinkwrap":false,"publish_time":1525750548588,"_cnpm_publish_time":1525750548588},"1.1.0":{"name":"in-gfw","version":"1.1.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":[["env"]],"plugins":["transform-runtime"]},"scripts":{"report-coverage":"codecov","pretest":"eslint *.js 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-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","babel-runtime":"^6.26.0","ci-info":"^1.1.3","codecov":"^3.0.1","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.1.0","mocha":"^5.1.1","mock-fs":"^4.4.2","nyc":"^11.7.1","proxyquire":"^2.0.1","util-promisify":"^2.1.0"},"dependencies":{"glob":"^7.1.2","is-wsl":"^1.1.0","mem":"^3.0.0"},"gitHead":"a0b010c9ef71e32503146f76a42f8f7f8064ffbc","_id":"in-gfw@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"gucong","email":"gucong@gmail.com"},"dist":{"shasum":"13578c2a7fb862b234d5484c90e4991ff663cee1","size":4750,"noattachment":false,"key":"/in-gfw/-/in-gfw-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/in-gfw/download/in-gfw-1.1.0.tgz"},"maintainers":[{"name":"gucong","email":"gucong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/in-gfw_1.1.0_1525229922733_0.9027125525675666"},"_hasShrinkwrap":false,"publish_time":1525229922801,"_cnpm_publish_time":1525229922801},"1.0.0":{"name":"in-gfw","version":"1.0.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":[["env"]],"plugins":["transform-runtime"]},"scripts":{"report-coverage":"codecov","pretest":"eslint *.js lib test","test":"node . && nyc mocha"},"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-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","babel-runtime":"^6.26.0","ci-info":"^1.1.3","codecov":"^3.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.10.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.0.1","mocha":"^5.0.5","mock-fs":"^4.4.2","nyc":"^11.6.0","proxyquire":"^2.0.1","util-promisify":"^2.1.0"},"dependencies":{"glob":"^7.1.2","is-wsl":"^1.1.0","mem":"^3.0.0"},"gitHead":"dc6796f2f9814414a6a955fa1a7734a5c5d29c26","_id":"in-gfw@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"gucong","email":"gucong@gmail.com"},"dist":{"shasum":"23ddaeae700dccb77a1b30606ad92df3d0d5c788","size":4750,"noattachment":false,"key":"/in-gfw/-/in-gfw-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/in-gfw/download/in-gfw-1.0.0.tgz"},"maintainers":[{"name":"gucong","email":"gucong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/in-gfw_1.0.0_1522666318466_0.9122714577798066"},"_hasShrinkwrap":false,"publish_time":1522666318512,"_cnpm_publish_time":1522666318512}},"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","_attachments":{},"homepage":"https://github.com/gucong3000/in-gfw#readme","bugs":{"url":"https://github.com/gucong3000/in-gfw/issues"},"license":"MIT"}