unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
358 stars 19 forks source link

feat(node): add `node:crypto` polyfill #90

Closed pi0 closed 1 year ago

pi0 commented 1 year ago

unjs/uncrypto has a dual export for node/web crypto but some libraries / export conditions won't pick it. It adds built-in crypto polywill via global natives to also avoid a mock with never-resolving promises.