{"_id":"punycode.js","_rev":"5-5e357e71ca14c91d7cf8f25fa0e24722","name":"punycode.js","dist-tags":{"latest":"2.3.1"},"versions":{"2.1.0":{"name":"punycode.js","version":"2.1.0","description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","homepage":"https://mths.be/punycode","main":"punycode.js","jsnext:main":"punycode.es6.js","module":"punycode.es6.js","engines":{"node":">=6"},"keywords":["punycode","unicode","idn","idna","dns","url","domain"],"license":"MIT","author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"contributors":[{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"}],"repository":{"type":"git","url":"git+https://github.com/bestiejs/punycode.js.git"},"bugs":{"url":"https://github.com/bestiejs/punycode.js/issues"},"files":["LICENSE-MIT.txt","punycode.js","punycode.es6.js"],"scripts":{"test":"mocha tests","prepublish":"node scripts/prepublish.js"},"devDependencies":{"codecov":"^1.0.1","istanbul":"^0.4.1","mocha":"^2.5.3"},"jspm":{"map":{"./punycode.js":{"node":"@node/punycode"}}},"gitHead":"cc9ecb5781701a89c78f6e8392e266c5f84b17ae","_id":"punycode.js@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"dist":{"integrity":"sha512-LvGUJ9QHiESLM4yn8JuJWicstRcJKRmP46psQw1HvCZ9puLFwYMKJWvkAkP3OHBVzNzZGx/D53EYJrIaKd9gZQ==","shasum":"f3937f7a914152c2dc17e9c280a2cf86a26b7cda","tarball":"https://registry.npmjs.org/punycode.js/-/punycode.js-2.1.0.tgz","fileCount":5,"unpackedSize":32372,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT4y70FwgMGXjZ2XWk6LfeRBK9cc0AA0PyTBpjg8Ny5QIhAJa2McrOWzMuB81ylgIxWXbfd40jD/VHncJs9sRmQDlJ"}]},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/punycode.js_2.1.0_1521100265684_0.9005663333252123"},"_hasShrinkwrap":false},"2.3.0":{"name":"punycode.js","version":"2.3.0","description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","homepage":"https://mths.be/punycode","main":"punycode.js","jsnext:main":"punycode.es6.js","module":"punycode.es6.js","engines":{"node":">=6"},"keywords":["punycode","unicode","idn","idna","dns","url","domain"],"license":"MIT","author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"contributors":[{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"}],"repository":{"type":"git","url":"git+https://github.com/mathiasbynens/punycode.js.git"},"bugs":{"url":"https://github.com/mathiasbynens/punycode.js/issues"},"scripts":{"test":"mocha tests","build":"node scripts/prepublish.js"},"devDependencies":{"codecov":"^1.0.1","istanbul":"^0.4.1","mocha":"^10.2.0"},"jspm":{"map":{"./punycode.js":{"node":"@node/punycode"}}},"gitHead":"44e6200b96c186ebc5de72dcce2bcdfe8a32bfbc","_id":"punycode.js@2.3.0","_nodeVersion":"14.21.2","_npmVersion":"6.14.17","dist":{"integrity":"sha512-AM9kSplQQCRlRkRZzx2EcqW2AQ9HuYoUzzl/tjJDNJEUeYHFGJ/rGE0a9cE1b41iuFz94pAwcEekC137Dd9Eyw==","shasum":"6aaa35964ffecc676545995ecb65980bd8302f61","tarball":"https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.0.tgz","fileCount":5,"unpackedSize":32934,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAeZR6ekBrE3BKFyL6SVvrCZjzdHrCoVl2ymrUO8qMaPAiBaAL7w6mAcAwDTBL6FjyjA5i1wl5cKriSa2B86mDvmHQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyYSqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwaQ//ez0YkNphjE3Ll2YQMgctJiCg+G9jlREvKVFyFA5Nf/Y1kvwG\r\nEikOEwLiV/iS5KBUIYinWUdryMbKcvIAX0fNsk1XmHfZan7Atppz2B+hk/IW\r\nqcOrC4S6iBZ4hbwFG4S/YZhDaG0KPEzqpc9+SCnkFG/TePDrWavd4/wXRyDv\r\n2G1BwYlt97gxyb14OYXlSE1XoZTso/ZyT+fk7KGLhcxEoprayGc5z8cyWpb9\r\nhlK5f6CWz4DWiUBtpyTIXFDS8aTFE79pR5wfYArdZb8jMN4Lz1Sw67nLg22d\r\nSAxBlE52RSOxWkrzZoqbjlfSCiIhXbELyvo3zxTee8fXCiSCx9As4Hc1K0mo\r\nzJnqDcje9KKwIKbofWuWr5KBrex8CdeZ7y/wBbOepqFHm+DBiguawroPhrMq\r\nwGnmTMUp/sRFnlrDvzfhk4V4fsHK35UlG4rjyAV/2Y9/IXwoAO4BVI7Er/E6\r\ni1GHpUwmqlW6xXruGSZz86U/f4iW6CfYZZW1FDYpCAK32GXrqbTK/ibrQ3H5\r\nmWbgHRj/PcsMiENO/VMIkiD+FznvE+c9nYzqFyhBT2qiJ1CGyeQgc9Kd4caK\r\nMesUXnqwELZIdsSfIwKgp9V4/e2j5+lbtc/+r7IbtuacbejmXknMmw/ZfqW/\r\nuMGjzTBYvorsVerTF2QunG00mMQaGDn5up4=\r\n=HTM3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/punycode.js_2.3.0_1674151082233_0.865786884773649"},"_hasShrinkwrap":false},"2.3.1":{"name":"punycode.js","version":"2.3.1","description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","homepage":"https://mths.be/punycode","main":"punycode.js","jsnext:main":"punycode.es6.js","module":"punycode.es6.js","engines":{"node":">=6"},"keywords":["punycode","unicode","idn","idna","dns","url","domain"],"license":"MIT","author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"contributors":[{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"}],"repository":{"type":"git","url":"git+https://github.com/mathiasbynens/punycode.js.git"},"bugs":{"url":"https://github.com/mathiasbynens/punycode.js/issues"},"scripts":{"test":"mocha tests","build":"node scripts/prepublish.js"},"devDependencies":{"codecov":"^3.8.3","nyc":"^15.1.0","mocha":"^10.2.0"},"jspm":{"map":{"./punycode.js":{"node":"@node/punycode"}}},"_id":"punycode.js@2.3.1","gitHead":"9e1b2cda98d215d3a73fcbfe93c62e021f4ba768","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==","shasum":"6b53e56ad75588234e79f4affa90972c7dd8cdb7","tarball":"https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz","fileCount":5,"unpackedSize":33517,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRPN4FwS13gZMEtHkaDjSb2ZPFXKKZlyUqtNbnqMUQKQIgGTFLxaUJymxaWjC1bc1qgnDJhn1mJYddztLOD5gYUoY="}]},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/punycode.js_2.3.1_1698690516239_0.530120365457522"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-15T07:51:05.683Z","2.1.0":"2018-03-15T07:51:05.927Z","modified":"2023-10-30T18:28:36.668Z","2.3.0":"2023-01-19T17:58:02.424Z","2.3.1":"2023-10-30T18:28:36.491Z"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","homepage":"https://mths.be/punycode","keywords":["punycode","unicode","idn","idna","dns","url","domain"],"repository":{"type":"git","url":"git+https://github.com/mathiasbynens/punycode.js.git"},"contributors":[{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"}],"author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"bugs":{"url":"https://github.com/mathiasbynens/punycode.js/issues"},"license":"MIT","readme":"# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/punycode) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode)\n\nPunycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891).\n\nThis JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:\n\n* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C)\n* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)\n* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)\n* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)\n* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))\n\nThis project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated).\n\nThis project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1).\n\n## Installation\n\nVia [npm](https://www.npmjs.com/):\n\n```bash\nnpm install punycode --save\n```\n\nIn [Node.js](https://nodejs.org/):\n\n> ⚠️ Note that userland modules don't hide core modules.\n> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`.\n> Use `require('punycode/')` to import userland modules rather than core modules.\n\n```js\nconst punycode = require('punycode/');\n```\n\n## API\n\n### `punycode.decode(string)`\n\nConverts a Punycode string of ASCII symbols to a string of Unicode symbols.\n\n```js\n// decode domain name parts\npunycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n```\n\n### `punycode.encode(string)`\n\nConverts a string of Unicode symbols to a Punycode string of ASCII symbols.\n\n```js\n// encode domain name parts\npunycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n```\n\n### `punycode.toUnicode(input)`\n\nConverts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.\n\n```js\n// decode domain names\npunycode.toUnicode('xn--maana-pta.com');\n// → 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');\n// → '☃-⌘.com'\n\n// decode email addresses\npunycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');\n// → 'джумла@джpумлатест.bрфa'\n```\n\n### `punycode.toASCII(input)`\n\nConverts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII.\n\n```js\n// encode domain names\npunycode.toASCII('mañana.com');\n// → 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');\n// → 'xn----dqo34k.com'\n\n// encode email addresses\npunycode.toASCII('джумла@джpумлатест.bрфa');\n// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'\n```\n\n### `punycode.ucs2`\n\n#### `punycode.ucs2.decode(string)`\n\nCreates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.\n\n```js\npunycode.ucs2.decode('abc');\n// → [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:\npunycode.ucs2.decode('\\uD834\\uDF06');\n// → [0x1D306]\n```\n\n#### `punycode.ucs2.encode(codePoints)`\n\nCreates a string based on an array of numeric code point values.\n\n```js\npunycode.ucs2.encode([0x61, 0x62, 0x63]);\n// → 'abc'\npunycode.ucs2.encode([0x1D306]);\n// → '\\uD834\\uDF06'\n```\n\n### `punycode.version`\n\nA string representing the current Punycode.js version number.\n\n## For maintainers\n\n### How to publish a new release\n\n1. On the `main` branch, bump the version number in `package.json`:\n\n ```sh\n npm version patch -m 'Release v%s'\n ```\n\n Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).\n\n Note that this produces a Git commit + tag.\n\n1. Push the release commit and tag:\n\n ```sh\n git push && git push --tags\n ```\n\n Our CI then automatically publishes the new release to npm, under both the [`punycode`](https://www.npmjs.com/package/punycode) and [`punycode.js`](https://www.npmjs.com/package/punycode.js) names.\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## License\n\nPunycode.js is available under the [MIT](https://mths.be/mit) license.\n","readmeFilename":"README.md"}