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 Jun 4, 2024 via pnpm

punycode 1.4.1

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.
Package summary
Share
0
issues
1
license
1
MIT
Package created
7 Sep 2011
Version published
20 Mar 2016
Maintainers
2
Total deps
1
Direct deps
0
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
1 Packages, Including:
punycode@1.4.1
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

0
All Dependencies CSV
ⓘ This is a list of punycode 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does punycode do?

Punycode.js is a powerful JavaScript library that serves as a Punycode converter, fully adhering to both RFC 3492 and RFC 5891 standards. This robust script operates efficiently across nearly all JavaScript platforms. Punycode performs encoding and decoding, transforming a string of Unicode symbols into a Punycode string of ASCII symbols and vice versa. For instance, using its functionality, 'mañana' can be encoded into 'maana-pta' or decoded back into its original form.

How do you use punycode?

To begin utilizing Punycode.js, install the package via npm using npm install punycode --save. Be aware that within Node.js, to import the userland Punycode module (rather than core one), use require('punycode/'). You can then efficiently use punycode.decode(string), punycode.encode(string), punycode.toUnicode(input), and punycode.toASCII(input) functions to handle the conversions between Unicode and Punycode. Here's a quick example of how to use punycode.decode and punycode.encode:

const punycode = require('punycode/');

// decode a domain name part
console.log(punycode.decode('maana-pta')); // outputs 'mañana'

// encode a domain name part
console.log(punycode.encode('mañana')); // outputs 'maana-pta'

For domain name conversions, use the punycode.toUnicode(input) and punycode.toASCII(input) functions.

// decode a domain name
console.log(punycode.toUnicode('xn--maana-pta.com')); // outputs 'mañana.com'

// encode a domain name
console.log(punycode.toASCII('mañana.com')); // outputs 'xn--maana-pta.com'

The library also features punycode.ucs2.decode(string) and punycode.ucs2.encode(codePoints) functions for operations involving Unicode code points.

Where are the punycode docs?

For comprehensive details on usage, consult the library's API section in the Punycode.js GitHub page. The page offers complete documentation, providing insightful explanations and code samples for each function and feature. This open-source project is actively maintained, ensuring up-to-date information and prompt responses to issues and inquiries.