mathiasbynens / punycode.js

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891.
https://mths.be/punycode
MIT License
1.59k stars 159 forks source link

Module export formats shouldn't be mutually exclusive #47

Closed andyearnshaw closed 8 years ago

andyearnshaw commented 8 years ago

See https://github.com/nodejs/node/issues/7224 for context. To summarise, if punycode.js detects a global AMD define, then nodeRequire('url').parse('http://foo.bar/baz) breaks because punycode exports nothing for Node's require.

A good solution to this would be to call both define() and assign to module.exports if possible.