Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest using punycode.js npm package #122

Open
silverwind opened this issue Dec 15, 2022 · 1 comment · May be fixed by #136
Open

Suggest using punycode.js npm package #122

silverwind opened this issue Dec 15, 2022 · 1 comment · May be fixed by #136

Comments

@silverwind
Copy link

silverwind commented Dec 15, 2022

https://www.npmjs.com/package/punycode.js appears to be a complete copy of https://www.npmjs.com/package/punycode, with the benefit that the name is not ambiguous with the deprecated node core module.

Can the README suggest using it? The workaround mentioned in the readme with require('punycode/') does not work with ESM (ERR_UNSUPPORTED_DIR_IMPORT), so there is no way currently to un-ambiguously import punycode in node ESM. I suggest to npm deprecate the punycode module in turn.

The only difference seems to be that 2.1.1 was not published on the punycode.js name.

@mathiasbynens
Copy link
Owner

Publication of both punycode and punycode.js is now automated for every Git tag pushed to this repository! I'm open to a PR that changes the README to recommend the use of punycode.js.

mcmire added a commit to mcmire/DefinitelyTyped that referenced this issue Apr 17, 2023
Since January 19th ([1]), the `punycode` package has also been published
under `punycode.js`. This solves the problem of needing to use
`punycode/` to use the package (as `punycode` is a built-in Node
package). However, types are missing for `punycode.js`. So this commit
adds them. Note that the interface for the package hasn't changed since
v2.1, so I didn't bump the version, just copied the existing type
definitions from `punycode`.

[1]: mathiasbynens/punycode.js#122
msimerson added a commit to msimerson/punycode.js that referenced this issue Mar 27, 2024
@msimerson msimerson linked a pull request Mar 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants