One thing I have noticed is the main export is a commonJS module, hence the examples "require", but this is not idomatic cloudflare worker. Cloudflare workers can support commonJS via their internal workaround https://blog.cloudflare.com/workers-javascript-modules/ but it is not its primary module mechanism, that is ESM.
One thing I have noticed is the main export is a commonJS module, hence the examples "require", but this is not idomatic cloudflare worker. Cloudflare workers can support commonJS via their internal workaround https://blog.cloudflare.com/workers-javascript-modules/ but it is not its primary module mechanism, that is ESM.
As I hate breaking backwards compatibility, we can support both by exporting two different packages https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html but I would suggest changing examples to ESM going forward. Of coure, both should be supported in integration tests so we never accidentally regress (see https://github.com/markusahlstrand/cloudworker-proxy/pull/130)