unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
340 stars 18 forks source link

Emulate `node:vm` #236

Closed pi0 closed 2 weeks ago

pi0 commented 1 month ago

Followup https://github.com/unjs/unenv/pull/226/

Although less secure, we could maximize runtime compatibility by emulating node:vm using eval or dynamic imports (if allowed)

Use-case: It would allow libs like jiti run within worker and browser contexts (however not ideal, but work!)

pi0 commented 2 weeks ago

Closing as is low priority (let's reopen if needed)