{"_id":"@ali1416/phone2region","_rev":"4-50ace4c322fb8c10ce27f0daa25c7848","name":"@ali1416/phone2region","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@ali1416/phone2region","version":"1.0.0","keywords":["phone","region"],"author":{"name":"ali","email":"ali-k@foxmail.com"},"license":"Apache-2.0","_id":"@ali1416/phone2region@1.0.0","maintainers":[{"name":"ali1416","email":"1416978277@qq.com"}],"homepage":"https://github.com/ALI1416/phone2region-js","bugs":{"url":"https://github.com/ALI1416/phone2region-js/issues/new"},"dist":{"shasum":"1706ace8d15010c51a7d18beccaf8c36f44ad1e5","tarball":"https://registry.npmjs.org/@ali1416/phone2region/-/phone2region-1.0.0.tgz","fileCount":19,"integrity":"sha512-dUUWmo6fotpzBPlJ8zHt4kn85jFe0NpMdJRcO0GBJUUtCLBWnfdOqhScbrVOGrgTHn/cIWPc6UdCV5TWWoPi6A==","signatures":[{"sig":"MEUCIBSgOenzkhNgXbFZ/oDNgKHrncQiNKZaJ8ZZQLZ8mRMkAiEAhfda22KJd7K7Fgqn3FjbfCQP0XOD7Du3Etvp8ZavpVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53149},"main":"./dist/phone2region.node.js","types":"./types/main.d.ts","module":"./lib/main.js","engines":{"node":">=14.0.0"},"scripts":{"tsc":"npx tsc","build":"npm run tsc && npm run rollup","rollup":"npx rollup -c --bundleConfigAsCjs"},"_npmUser":{"name":"ali1416","email":"1416978277@qq.com"},"repository":{"url":"git+https://github.com/ALI1416/phone2region-js.git","type":"git"},"_npmVersion":"10.8.2","description":"手机号码转区域JavaScript版","directories":{},"_nodeVersion":"20.11.1","dependencies":{"@zip.js/zip.js":"^2.7.48"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.20.0","typescript":"^5.5.4","@babel/core":"^7.25.2","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/phone2region_1.0.0_1723793126655_0.9588994074837001","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@ali1416/phone2region","version":"1.1.0","keywords":["phone","region"],"author":{"name":"ali","email":"ali-k@foxmail.com"},"license":"Apache-2.0","_id":"@ali1416/phone2region@1.1.0","maintainers":[{"name":"ali1416","email":"1416978277@qq.com"}],"homepage":"https://github.com/ALI1416/phone2region-js","bugs":{"url":"https://github.com/ALI1416/phone2region-js/issues/new"},"dist":{"shasum":"ee74378eadf603beb8e2857e4f600f64d18d26b0","tarball":"https://registry.npmjs.org/@ali1416/phone2region/-/phone2region-1.1.0.tgz","fileCount":19,"integrity":"sha512-69zMXnYLEE1UhDUBGhhkzSfnPGoEB9HpzrP033AclZhjVC+uVC++y2PAgemh73jadLHFmMIZa1SV1lfkoCSADQ==","signatures":[{"sig":"MEQCIFtuYatARDRfjsotbkNnIjQRv0lx8ZZujIwgbL1Q3c6eAiBSpGPp5KhHQVpZQPtsgArXj7wa5ivlCF8wUa82X5hoEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53377},"main":"./dist/phone2region.node.js","types":"./types/main.d.ts","module":"./lib/main.js","engines":{"node":">=14.0.0"},"gitHead":"2bfc56b86620ec75cd26519f81fe28ae99b99113","scripts":{"tsc":"npx tsc","build":"npm run tsc && npm run rollup","rollup":"npx rollup -c --bundleConfigAsCjs"},"_npmUser":{"name":"ali1416","email":"1416978277@qq.com"},"repository":{"url":"git+https://github.com/ALI1416/phone2region-js.git","type":"git"},"_npmVersion":"10.8.2","description":"手机号码转区域JavaScript版","directories":{},"_nodeVersion":"20.11.1","dependencies":{"@zip.js/zip.js":"^2.7.48"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.20.0","typescript":"^5.5.4","@babel/core":"^7.25.2","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/phone2region_1.1.0_1724051547005_0.7775235508689451","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@ali1416/phone2region","version":"1.2.0","keywords":["phone","region"],"author":{"name":"ali","email":"ali-k@foxmail.com"},"license":"Apache-2.0","_id":"@ali1416/phone2region@1.2.0","maintainers":[{"name":"ali1416","email":"1416978277@qq.com"}],"homepage":"https://github.com/ALI1416/phone2region-js","bugs":{"url":"https://github.com/ALI1416/phone2region-js/issues/new"},"dist":{"shasum":"3b04debff3bdf9ed41eab8114cbc9bf2a3577d8a","tarball":"https://registry.npmjs.org/@ali1416/phone2region/-/phone2region-1.2.0.tgz","fileCount":19,"integrity":"sha512-jtuKex+6NXl/Oyje9VswhpuWjq6tGtvPH8/b78D/LdUf4PUTGtXSkUFDdbRvu6vyYGBWMJyPZsLMM2wSRNfBPQ==","signatures":[{"sig":"MEYCIQCugah0kDq9xyU/SJdtd29G61d95+kTJy8xEn/Zcb8r5gIhAOa+9Pb98Cv/aW6szT/HPpZ+QOeobxuVhSho0UnY4kZq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55494},"main":"./dist/phone2region.node.js","types":"./types/main.d.ts","module":"./lib/main.js","engines":{"node":">=14.0.0"},"gitHead":"3c57f7019976adab9b2ceae5472c85543a44b6e6","scripts":{"tsc":"npx tsc","build":"npm run tsc && npm run rollup","rollup":"npx rollup -c --bundleConfigAsCjs"},"_npmUser":{"name":"ali1416","email":"1416978277@qq.com"},"repository":{"url":"git+https://github.com/ALI1416/phone2region-js.git","type":"git"},"_npmVersion":"10.8.2","description":"手机号码转区域JavaScript版","directories":{},"_nodeVersion":"22.11.0","dependencies":{"@zip.js/zip.js":"^2.7.53"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.28.0","typescript":"^5.7.2","@babel/core":"^7.26.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/phone2region_1.2.0_1733213740782_0.2682318322512074","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"@ali1416/phone2region","version":"1.3.0","description":"手机号码转区域JavaScript版","scripts":{"tsc":"tsc","rollup":"rollup -c","build":"npm run tsc && npm run rollup"},"main":"./dist/phone2region.node.js","module":"./lib/main.js","types":"./types/main.d.ts","author":{"name":"ali","email":"ali-k@foxmail.com"},"keywords":["phone","region"],"license":"Apache-2.0","homepage":"https://github.com/ALI1416/phone2region-js","bugs":{"url":"https://github.com/ALI1416/phone2region-js/issues/new"},"repository":{"type":"git","url":"git+https://github.com/ALI1416/phone2region-js.git"},"engines":{"node":">=14.13.0"},"publishConfig":{"access":"public"},"dependencies":{"@zip.js/zip.js":"^2.8.34"},"devDependencies":{"@babel/core":"^7.29.7","@rollup/plugin-babel":"^7.1.0","@rollup/plugin-terser":"^1.0.0","rollup":"^4.62.4","typescript":"^7.0.2"},"gitHead":"84db03631119c0ec1dc4964c6ffceb9e39098dfb","_id":"@ali1416/phone2region@1.3.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-IB0To9M4C32hjmDpbwZuiR0KtwDtJuaDjHi6nP2lhEdwquaGOtuPEG2OC39blHfFTZ+zNOuxBP3ikuwNGR0ihA==","shasum":"35e8ace2e44edb3cd0c680095c56f83f8358e2f7","tarball":"https://registry.npmjs.org/@ali1416/phone2region/-/phone2region-1.3.0.tgz","fileCount":19,"unpackedSize":55806,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCrrsbAQ+Q2Gaw5LAOadEIes4difrj15k7rein8UMsOfQIhANngw34dZ18sXFq57T1vspXtB0+FdYTztEDyAXh9M9Ts"}]},"_npmUser":{"name":"ali1416","email":"1416978277@qq.com"},"directories":{},"maintainers":[{"name":"ali1416","email":"1416978277@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/phone2region_1.3.0_1786179283532_0.7201565215155152"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-16T07:25:26.523Z","modified":"2026-08-08T08:54:43.825Z","1.0.0":"2024-08-16T07:25:26.823Z","1.1.0":"2024-08-19T07:12:27.224Z","1.2.0":"2024-12-03T08:15:41.067Z","1.3.0":"2026-08-08T08:54:43.674Z"},"bugs":{"url":"https://github.com/ALI1416/phone2region-js/issues/new"},"author":{"name":"ali","email":"ali-k@foxmail.com"},"license":"Apache-2.0","homepage":"https://github.com/ALI1416/phone2region-js","keywords":["phone","region"],"repository":{"type":"git","url":"git+https://github.com/ALI1416/phone2region-js.git"},"description":"手机号码转区域JavaScript版","maintainers":[{"name":"ali1416","email":"1416978277@qq.com"}],"readme":"# Phone Number To Region For JavaScript 手机号码转区域JavaScript版\r\n\r\n[![License](https://img.shields.io/github/license/ALI1416/phone2region-js?label=License)](https://www.apache.org/licenses/LICENSE-2.0.txt)\r\n[![Node Support](https://img.shields.io/badge/Node-14+-green)](https://nodejs.org/)\r\n[![NPM](https://img.shields.io/npm/v/@ali1416/phone2region?label=NPM)](https://www.npmjs.com/package/@ali1416/phone2region)\r\n[![Tag](https://img.shields.io/github/v/tag/ALI1416/phone2region-js?label=Tag)](https://github.com/ALI1416/phone2region-js/tags)\r\n[![Repo Size](https://img.shields.io/github/repo-size/ALI1416/phone2region-js?label=Repo%20Size&color=success)](https://github.com/ALI1416/phone2region-js/archive/refs/heads/master.zip)\r\n\r\n[![Node CI](https://github.com/ALI1416/phone2region-js/actions/workflows/ci.yml/badge.svg)](https://github.com/ALI1416/phone2region-js/actions/workflows/ci.yml)\r\n\r\n## 简介\r\n\r\n本项目迁移自[ALI1416/phone2region](https://github.com/ALI1416/phone2region)，构建后`phone2region.min.js`文件仅`3kb`\r\n\r\n[在线示例](https://www.404z.cn/demo/phone2region.html)\r\n\r\n## 数据文件\r\n\r\n- 数据文件目录：[点击查看](https://github.com/ALI1416/phone2region/tree/master/data)\r\n- 最新版本：`v2.4.0`\r\n- 点击下载：[![phone2region.zdb](https://img.shields.io/github/size/ALI1416/phone2region/data/phone2region.zdb?label=phone2region.zdb&color=success&branch=v2.4.0)](https://www.404z.cn/files/phone2region/v2.4.0/data/phone2region.zdb)\r\n\r\n### 其他语言项目\r\n\r\n- `Java` : [ALI1416/phone2region](https://github.com/ALI1416/phone2region)\r\n- `.Net` : [ALI1416/Phone2Region.Net](https://github.com/ALI1416/Phone2Region.Net)\r\n\r\n## 依赖导入\r\n\r\n### 网页\r\n\r\n<https://unpkg.com/@zip.js/zip.js/dist/zip.min.js>\r\n<https://unpkg.com/@ali1416/phone2region/dist/phone2region.min.js>\r\n\r\n### node\r\n\r\n```sh\r\nnpm install @ali1416/phone2region\r\n```\r\n\r\n## 使用示例\r\n\r\n```js\r\n// node test-node.js\r\nconst fs = require('fs')\r\nconst {Phone2Region} = require('../dist/phone2region.node')\r\n\r\nlet url = 'https://www.404z.cn/files/phone2region/v2.0.0/data/phone2region.zdb'\r\nlet zdbPath = 'E:/phone2region.zdb'\r\n\r\nlet phone2Region = new Phone2Region()\r\n\r\n// runUrl()\r\nrunFile()\r\n\r\nasync function runUrl() {\r\n  await phone2Region.initByUrl(url)\r\n  run()\r\n}\r\n\r\nasync function runFile() {\r\n  console.log(`是否已经初始化：${phone2Region.initialized()}`)\r\n  let buffer = fs.readFileSync(zdbPath).buffer\r\n  await phone2Region.init(buffer)\r\n  console.log(`是否已经初始化：${phone2Region.initialized()}`)\r\n  run()\r\n}\r\n\r\nfunction run() {\r\n  console.log(phone2Region.parse('1875471'))\r\n  console.log(phone2Region.parse('18754710000'))\r\n  console.log(phone2Region.parse7(1875471))\r\n  console.log(phone2Region.parse11(18754710000))\r\n}\r\n```\r\n\r\n更多请见[测试](./test)\r\n\r\n## 更新日志\r\n\r\n[点击查看](./CHANGELOG.md)\r\n\r\n## 参考\r\n\r\n- [ALI1416/phone2region](https://github.com/ALI1416/phone2region)\r\n\r\n## 关于\r\n\r\n<picture>\r\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://www.404z.cn/images/about.dark.svg\">\r\n  <img alt=\"About\" src=\"https://www.404z.cn/images/about.light.svg\">\r\n</picture>\r\n","readmeFilename":"README.md"}