unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples

lawrencecchen opened this issue · comments

How can I use this? Are there any examples? Looking to port stripe-node to work on cloudflare pages and wasn't sure if this would be one of unenv's use cases. If someone could guide me, would love to start and contribute an examples folder.

I subscribe to this one. Are there docs to read further about how unenv works?

Not sure but this helped me

#39

Thanks for linking @wobsoriano. PR is more than welcome if you like to contribute to the docs! I can also give an outline to help :)

Im looking to try running express in a worker, should I give up? I can't tell how I'd convert a worker event to a request for express.

@pi0 I'd be happy to contribute docs and or runnable examples, once I understand how to apply this to projects and/or libraries consumed by those projects.

For my use case, I am trying to get around something simple like using libraries like lodash in middleware.js and running into the Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Middleware error when building a Next.js 12 project for production for it's Edge Runtime. In the case with lodash it has a Node API (Buffer) which is throwing an error.