mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 00:29:09 -05:00
1 line
7.7 KiB
JSON
1 line
7.7 KiB
JSON
{"name":"punycode","description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","dist-tags":{"latest":"2.1.1"},"versions":{"2.1.1":{"name":"punycode","version":"2.1.1","description":"A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.","main":"punycode.js","jsnext:main":"punycode.es6.js","module":"punycode.es6.js","engines":{"node":">=6"},"license":"MIT","author":{"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":"68df855dc42d1086ada161331b3074468e8d848d","_id":"punycode@2.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","dist":{"integrity":"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==","shasum":"b58b010ac40c22c5657616c8d2c2c02c7bf479ec","tarball":"http://localhost:4260/punycode/punycode-2.1.1.tgz","fileCount":5,"unpackedSize":32434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbA4SZCRA9TVsSAnZWagAA5ZYP/0UOrnGue5Uhy1In5lOe\nh8pglPP9+qBCRx+nfe+YgmPV45IdYadH6InqCibkxAAeZ+j+Sc0g4I1Vv9SF\nPDXiA34tNt12kmLgFSEmdAhbxa87bGtvTnPCzme1iZfmqYmc7GE/q2iazWxd\n9R2im5Xr1oUwZCe0jiY2Le7HOhd+Mnkd76pdknseybWYJxf1RbNSDCtOxndO\nMsZU2CzhG38CFyPVozm+5+XEf5QD3cjKpwpZKZOxVTJ8dwB9FK5SLAvCQSGW\nO15Bili5YCxi2053KDvP/4VGMGdVxPLIp5E+uJyeZSwqVAiqmtk52iLJq4iO\nTs0B3tkKxi3Rxkk5vr0OvvOk6iIW+jkcgaQTFj8jZaGmvvGXztR5F2RDsrDr\nfrXKkahtw+W7u3eoAahCh4FgvJ3sclI23Ik2+ahQQR7B3+AsJ/hVP365RpZo\nSnR/YC+QtfzFJYwbepvg2rhaOqkiGk3dcWS53r2hUm6Ugd0AIR8Cmjuqbsrd\nUaeS+WfpvoceuU45rC9nSCPYms9bBNYBN0leYPb+okOWFbZI5v/gp86CfRs3\n8gwadUA99Z8IFcjzpiIEkmPkk3Z8y5tGXIw66FGuxVDE/tPBORGmEOCPEVpg\nJ/zsiqblJ9pTTGDKTdKxFF4fNq3koen1N4ZAIAoZqJUq7pGEzwjWy9Zw/+JW\nRaNl\r\n=ncBz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcK2xxRA8qZpahqjEJb2iYYQ3oB5CZL1nabOwakIbRUAiEAzxUMeTgnO/0/ZBwQCOBSmpV8FR0PGra5FS51nJmaeTw="}]},"directories":{},"_hasShrinkwrap":false}},"author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"repository":{"type":"git","url":"git+https://github.com/bestiejs/punycode.js.git"},"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/codecov/c/github/bestiejs/punycode.js.svg)](https://codecov.io/gh/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)\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\nThe current version supports recent versions of Node.js only. It provides a CommonJS module and an ES6 module. For the old version that offers the same functionality with broader support, including Rhino, Ringo, Narwhal, and web browsers, see [v1.4.1](https://github.com/bestiejs/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```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## 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","homepage":"https://mths.be/punycode","bugs":{"url":"https://github.com/bestiejs/punycode.js/issues"},"license":"MIT"}
|