© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•15mo ago
Luke

Migrating to ES Modules

I have a fairly large project written with the Service Worker syntax. Because of this I'm using the global variables for bindings and environment variables in a lot of places. Can I use something like
AsyncLocalStorage
AsyncLocalStorage
with the nodejs_compat flag to prevent a large code rewrite? Is there any performance implications to this or redflags I should be aware of?
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

ES Modules and Cloudflare Workers
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Clarify Docs On How To Access Environmental Variables/Secrets in ES Modules format with TypeScript
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
16mo ago
Error: EMFILE: too many open files, open '/opt/buildhome/repo/node_modules/lodash-es/lt.js'
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
12mo ago