Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 4, 2024 via pnpm

tr46 3.0.0

An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing
Package summary
Share
0
issues
1
license
2
MIT
Package created
6 Jun 2015
Version published
3 Oct 2021
Maintainers
6
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
punycode@2.3.1
tr46@3.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of tr46 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
punycode2.3.17.42 kBMIT
prod

Visualizations

Frequently Asked Questions

What does tr46 do?

TR46 is a JavaScript implementation of the Unicode Technical Standard #46: Unicode IDNA Compatibility Processing. It is used to convert a string of Unicode symbols to a case-folded Punycode string of ASCII symbols and vice versa. Therefore, this popular npm package is the key to making your non-latin domain names compatible with the all-ASCII character constraints of the Domain Name System (DNS).

How do you use tr46?

The TR46 package can be incorporated into your JavaScript project relatively easily. After installation, you have access to two key methods: toASCII(domainName[, options]) and toUnicode(domainName[, options]). Here's a simple implementation example:

const tr46 = require('tr46');

let ascii = tr46.toASCII('example.com', {
    checkBidi: true,
    checkHyphens: true,
    checkJoiners: true,
    processingOption: 'nontransitional',
    useSTD3ASCIIRules: true,
    verifyDNSLength: true
});

let unicode = tr46.toUnicode('example.com', {
    checkBidi: true,
    checkHyphens: true,
    checkJoiners: true,
    processingOption: 'nontransitional',
    useSTD3ASCIIRules: true,
    verifyDNSLength: true
});

In this code, you use the toASCII() and toUnicode() methods to convert domain names. The methods receive two arguments: a domain name and an optional object with options for conversion.

Where are the tr46 docs?

The official documentation for the TR46 npm package is hosted on the official TR46 GitHub repository. It provides detailed descriptions of the API, including the list of available methods and options for conversion. The GitHub page is an excellent source of the most recent updates and usage examples for the TR46 package.