{"_id":"punycode-okam","_rev":"3463264","name":"punycode-okam","description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","dist-tags":{"latest":"1.4.1"},"maintainers":[{"name":"sorrycc","email":""}],"time":{"modified":"2024-08-27T19:36:32.000Z","created":"2023-07-24T06:51:05.398Z","1.4.1":"2023-07-24T07:02:28.405Z","2.3.0":"2023-07-24T06:51:05.398Z"},"users":{},"author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"repository":{"type":"git","url":"git+https://github.com/bestiejs/punycode.js.git"},"versions":{"1.4.1":{"name":"punycode-okam","version":"1.4.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","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/"},{"name":"John-David Dalton","url":"http://allyoucanleet.com/"}],"repository":{"type":"git","url":"git+https://github.com/bestiejs/punycode.js.git"},"bugs":{"url":"https://github.com/bestiejs/punycode.js/issues"},"scripts":{"test":"node tests/tests.js"},"devDependencies":{"coveralls":"^2.11.4","grunt":"^0.4.5","grunt-contrib-uglify":"^0.11.0","grunt-shell":"^1.1.2","istanbul":"^0.4.1","qunit-extras":"^1.4.4","qunitjs":"~1.11.0","requirejs":"^2.1.22"},"jspm":{"map":{"./punycode.js":{"node":"@node/punycode"}}},"_id":"punycode-okam@1.4.1","_nodeVersion":"18.14.0","_npmVersion":"9.6.5","dist":{"shasum":"e0404d4be30147fbee874e75d5bf3e75efb8efdc","size":8049,"noattachment":false,"key":"/punycode-okam/-/punycode-okam-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/punycode-okam/download/punycode-okam-1.4.1.tgz"},"_npmUser":{"name":"sorrycc","email":"sorrycc@gmail.com"},"directories":{},"maintainers":[{"name":"sorrycc","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/punycode-okam_1.4.1_1690182148205_0.9525527972816632"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-24T07:02:28.405Z","publish_time":1690182148405,"_source_registry_name":"default","_cnpm_publish_time":1690182148405},"2.3.0":{"name":"punycode-okam","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"}}},"_id":"punycode-okam@2.3.0","_nodeVersion":"18.14.0","_npmVersion":"9.6.5","dist":{"shasum":"50c24ac82968dc6299f9635dbfb598bb3a205403","size":7376,"noattachment":false,"key":"/punycode-okam/-/punycode-okam-2.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/punycode-okam/download/punycode-okam-2.3.0.tgz"},"_npmUser":{"name":"sorrycc","email":"sorrycc@gmail.com"},"directories":{},"maintainers":[{"name":"sorrycc","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/punycode-okam_2.3.0_1690181465121_0.8189576480782828"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-24T06:51:05.398Z","publish_time":1690181465398,"_source_registry_name":"default","_cnpm_publish_time":1690181465398}},"readme":"# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)\n\nA robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.\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 is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) and [io.js v1.0.0+](https://github.com/iojs/io.js/blob/v1.x/lib/punycode.js).\n\n## Installation\n\nVia [npm](https://www.npmjs.com/) (only required for Node.js releases older than v0.6.2):\n\n```bash\nnpm install punycode\n```\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install punycode\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install bestiejs/punycode.js\n```\n\nIn a browser:\n\n```html\n<script src=\"punycode.js\"></script>\n```\n\nIn [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar punycode = require('punycode');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('punycode.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'punycode': 'path/to/punycode'\n    }\n  },\n  ['punycode'],\n  function(punycode) {\n    console.log(punycode);\n  }\n);\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## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.\n\nTo generate the code coverage report, use `grunt cover`.\n\nFeel free to fork if you see possible improvements!\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## Contributors\n\n| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## License\n\nPunycode.js is available under the [MIT](https://mths.be/mit) license.\n","_attachments":{},"homepage":"https://mths.be/punycode","bugs":{"url":"https://github.com/bestiejs/punycode.js/issues"},"license":"MIT"}