{"name":"idna-uts46-hx","version":"6.1.7","keywords":["unicode","idn","idna","domain","convert","converter"],"license":"MIT","_id":"idna-uts46-hx@6.1.7","maintainers":[{"name":"papakai","email":"kai.schwarz.dev@gmail.com"}],"homepage":"https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46","bugs":{"url":"https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46/issues"},"dist":{"shasum":"629c7beab2cc86da68956f62969b091cf2573b70","tarball":"http://registry-npm.ywwl.com/idna-uts46-hx/download/idna-uts46-hx-6.1.7.tgz","fileCount":8,"integrity":"sha512-CcYEtQLQA0qhGvdwuI7tPFdavsK2TjzMi7zmbY+8HDwP+hTU4qtiWwbfScrsgGCeh8LZ0G/uYv6XhmTb4h8+Tg==","signatures":[{"sig":"MEUCIQCeuEcv5iEP+QmA6mYA6lMSEPg/pAC/AKzBWjGNpPfptAIgGOFuW2qXGP/ltyO9JmihHpZ2K9BmKnDR7QhI1FG7y7o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":677724,"size":194177,"noattachment":false,"key":"/idna-uts46-hx/-/idna-uts46-hx-6.1.7.tgz"},"main":"dist/index.mjs","type":"module","engines":{"node":"^22.14.0 || >= 24.10.0"},"gitHead":"936759f719a3c4414af8f1a64b976be248e525bd","private":false,"scripts":{"lint":"eslint .","test":"mocha","build":"rollup -c rollup-esm.config.mjs","serve":"vite","prepare":"pnpm run build && npx lint-staged","pretest":"pnpm run prepare","preserve":"pnpm run prepare; cp node_modules/mocha/mocha.css dist/index.bundle.js dist/index.mjs test","prettier":"prettier -u --write \"**/*\"","test:coverage":"c8 --reporter=html mocha","posttest:coverage":"vite --config vite.config.coverage.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"papakai","email":"kai.schwarz.dev@gmail.com"},"prettier":{"tabWidth":2,"singleQuote":true,"trailingComma":"all"},"repository":{"url":"git+https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46.git","type":"git"},"_npmVersion":"11.12.1","description":"Convert Domain Names correctly from IDN to Punycode and vice-versa and offer TR46 processing.","directories":{},"lint-staged":{"*":"prettier -u --write"},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"tr46":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^11.0.0","vite":"^7.3.1","mocha":"^11.7.5","eslint":"^10.0.2","rollup":"^4.59.0","terser":"^5.46.0","globals":"^17.4.0","prettier":"^3.8.1","@eslint/js":"^10.0.1","lint-staged":"^16.3.2","semantic-release":"^25.0.3","@rollup/plugin-json":"^6.1.0","@rollup/plugin-terser":"^1.0.0","@semantic-release/git":"^10.0.1","@semantic-release/exec":"^7.1.0","@rollup/plugin-commonjs":"^29.0.1","rollup-plugin-bundle-size":"^1.0.3","@rollup/plugin-node-resolve":"^16.0.3","@semantic-release/changelog":"^6.0.3","semantic-release-teams-notify-plugin":"github:centralnicgroup-opensource/rtldev-middleware-semantic-release-notify-plugin"},"_npmOperationalInternal":{"tmp":"tmp/idna-uts46-hx_6.1.7_1775146334208_0.7661034429448756","host":"s3://npm-registry-packages-npm-production"},"readme":"# IDNA-UTS #46 in JavaScript\n\n[![npm version](https://img.shields.io/npm/v/idna-uts46-hx.svg?style=flat)](https://www.npmjs.com/package/idna-uts46-hx)\n[![node](https://img.shields.io/node/v/idna-uts46-hx.svg)](https://www.npmjs.com/package/idna-uts46-hx)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46/blob/main/CONTRIBUTING.md)\n\nThis module is a IDNA UTS46 connector library for javascript. In addition to the default functionality of tr46, we offer converting domain names to unicode / punycode considering the respective registry provider's behavior.\n\nThe [JS Punycode converter library](https://github.com/bestiejs/punycode.js/) is\na great tool for handling Unicode domain names, but it only implements the\nPunycode encoding of domain labels, not the full IDNA algorithm. In simple\ncases, a mere conversion to lowercase text before input would seem sufficient,\nbut the real mapping for strings is far more complex. This library implements\nthe full mapping for these strings, as defined by\n[UTS #46](http://unicode.org/reports/tr46/).\n\n## Resources\n\n- [Documentation](https://support.centralnicreseller.com/hc/en-gb/articles/13509920188061-JavaScript-based-IDN-Converter)\n- [Release Notes](https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46/releases)\n\n## Command Line Interface\n\nThe package ships the `idna-uts46-hx` executable. Use it without installing:\n\n```bash\nnpx idna-uts46-hx öbb.at\n# öbb.at\txn--bb-eka.at\n```\n\nBy default every input domain name is printed as `<unicode>` and `<punycode>`,\nseparated by a tab. Restrict the output to one of both representations with\n`--to`:\n\n```bash\nidna-uts46-hx --to ascii faß.de\n# xn--fa-hia.de\n\nidna-uts46-hx --to unicode xn----5da7e.de\n# ä-ü.de\n```\n\nDomain names can be passed as arguments or piped in via stdin, one per line,\nwhich makes bulk conversion straightforward:\n\n```bash\ncat domains.txt | idna-uts46-hx --to ascii > punycode.txt\n```\n\nUse `--json` for machine-readable output, including per-domain error messages:\n\n```bash\nidna-uts46-hx --json öbb.at\n# [\n#   {\n#     \"input\": \"öbb.at\",\n#     \"IDN\": \"öbb.at\",\n#     \"PC\": \"xn--bb-eka.at\"\n#   }\n# ]\n```\n\n### Options\n\n| **Option**            | **Description**                                 |\n| --------------------- | ----------------------------------------------- |\n| `-t`, `--to <mode>`   | `ascii`, `unicode` or `both` (default: `both`)  |\n| `-j`, `--json`        | emit JSON instead of plain text                 |\n| `-s`, `--separator`   | column separator for mode `both` (default: tab) |\n| `--transitional`      | force `transitionalProcessing` on               |\n| `--no-transitional`   | force `transitionalProcessing` off              |\n| `--std3`              | apply `useSTD3ASCIIRules`                       |\n| `--verify-dns-length` | apply `verifyDNSLength`                         |\n| `--check-hyphens`     | apply `checkHyphens`                            |\n| `--check-bidi`        | apply `checkBidi`                               |\n| `--check-joiners`     | apply `checkJoiners`                            |\n| `-h`, `--help`        | show the help                                   |\n| `-v`, `--version`     | show the version                                |\n\nWithout `--transitional` / `--no-transitional`, transitional processing is\nauto-detected from the TLD, just like in the library API.\n\nThe exit code is `0` when all conversions succeeded, `1` when at least one\ndomain name could not be converted (the reason is written to stderr, the\nremaining domain names are still processed) and `2` on invalid usage.\n\n## v6 Notes & Migration Guide\n\nWith v6 we migrated our library to npm package `tr46` as software dependency. By that step we use a library that is actively maintained in direction of correctly supporting the `TR46` standard and supporting the latest Version of the Unicode Standard. Reinventing the wheel isn't useful and something we have time or resources for. We were able to dramatically decrease the number of lines of code on our end.\n\n### Improvements\n\n- method `toUnicode` comes with auto-detection of `transitionalProcessing` setting based on the provided domain name input\n- method `toAscii` comes with auto-detection of `transitionalProcessing` setting based on the provided domain name input\n\n### Breaking Changes\n\nIn general, we don't see a blocker for upgrading to v6. Still, consider the below changes.\n\n#### Performance\n\nRuntime performance of v6 compared to v5 has slightly improved. The compression for the underlying idna mapping table is superfluous, tr46 covers it well.\n\n#### New Labels for Options\n\nThe below configuration options for the methods `toUnicode`and `toAscii` must be renamed in case you're using them:\n\n| **Option, old** | **Option, new**        |\n| --------------- | ---------------------- |\n| transitional    | transitionalProcessing |\n| useStd3ASCII    | useSTD3ASCIIRules      |\n| verifyDnsLength | verifyDNSLength        |\n\n#### Behavior\n\nEarlier versions kept option `transitional` by default to false which is now automatically detected and results may therefore differ.\nThis affects the `toAscii` method.\n\nThe `toUnicode` function did not allow for a options parameter in earlier versions, now it follows the exemplary way of package `tr46`.\n\n## Authors\n\n- [KaiSchwarz-cnic](https://github.com/kaischwarz-cnic)\n\n**Thanks for the below former contributions:**\n\n- Initial work done by [jcranmer](https://github.com/jcranmer).\n- v5: Migration of the IDNA Mapping Table's Build Process from Python to NodeJS5 by [dawsbot](https://github.com/dawsbot)\n- v5: Performance Improvements for the Browser Bundle's Page Load by [dawsbot](https://github.com/dawsbot)\n\nSee also the list of [contributors](https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46/graphs/contributors) who participated in this project.\n\n## License\n\nMIT\n","publish_time":1775146334386,"_cnpm_publish_time":1775146334386,"dist-tags":{"latest":"6.2.4"}}