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

fix: favor globalThis.crypto over require('crypto') #1

Closed
wants to merge 1 commit into from

Conversation

styfle
Copy link
Owner

@styfle styfle commented Aug 3, 2023

In runtimes outside of Node.js, require() is not defined.

So we should favor globalThis.crypto and only fallback to require('crypto') for older versions of Node.js

https://nodejs.org/api/globals.html#crypto_1

This is following up on the work from PR brianc#3033.

In runtimes outside of Node.js, `require()` is not defined.

So we should favor `globalThis.crypto` and only fallback to `require('crypto')` for older versions of Node.js

https://nodejs.org/api/globals.html#crypto_1
@styfle styfle closed this Aug 3, 2023
@styfle styfle deleted the fix-globalthis-crypto-precedence branch August 4, 2023 22:12
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 this pull request may close these issues.

1 participant