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 158 forks source link

Fix README falsely claiming browser support doesn't work #118

Closed Macil closed 1 year ago

Macil commented 2 years ago

The Readme currently claims that this project does not work in browsers, but this is wrong. I think the note in the Readme was originally meant to claim that the project no longer worked in pre-ES6 browsers, but that hasn't described any modern browsers for years now. This library works perfectly fine when used as directly a native ES6 module in browsers (try await import('https://unpkg.com/punycode@2.1.1/punycode.es6.js') in your browser console) or when used with a bundler like Webpack. (Webpack v5's documentation even explicitly recommends using this library as a shim for the Node "punycode" API when targeting browsers.)

This PR tweaks a line in the readme to emphasize that browser support does in fact work.