The code assumes that module is always available, which is not true (e.g. browser with requireJS). With the following UMD boilerplate it can be much friendlier to use in different environments.
The changes would be straightforward:
Remove the module.exports = punycode; line at the very end
The code assumes that
module
is always available, which is not true (e.g. browser with requireJS). With the following UMD boilerplate it can be much friendlier to use in different environments.The changes would be straightforward:
Remove the
module.exports = punycode;
line at the very endWrap remaining code like this:
}(this, function () {