[{"data":1,"prerenderedAt":528,"buildId":529},["ShallowReactive",2],{"\u002Fgetting-started\u002Fruntime-support":3,"\u002Fgetting-started\u002Fruntime-support-surround":426,"navigation":437},{"id":4,"title":5,"body":6,"description":417,"extension":418,"links":419,"meta":420,"navigation":421,"path":422,"seo":423,"stem":424,"__hash__":425},"docs\u002F1.getting-started\u002F4.runtime-support.md","Runtime support",{"type":7,"value":8,"toc":407},"minimark",[9,13,18,175,179,182,194,197,210,213,228,232,237,327,330,344,348,354,396,400,403],[10,11,5],"h1",{"id":12},"runtime-support",[14,15,17],"h2",{"id":16},"overview","Overview",[19,20,21,46],"table",{},[22,23,24],"thead",{},[25,26,27,31,34,37,40,43],"tr",{},[28,29,30],"th",{},"Feature",[28,32,33],{},"Node.js",[28,35,36],{},"Bun",[28,38,39],{},"Deno",[28,41,42],{},"workerd",[28,44,45],{},"Browser",[47,48,49,66,82,99,114,129,145,160],"tbody",{},[25,50,51,55,58,60,62,64],{},[52,53,54],"td",{},"Detection",[52,56,57],{},"Yes",[52,59,57],{},[52,61,57],{},[52,63,57],{},[52,65,57],{},[25,67,68,71,73,75,77,80],{},[52,69,70],{},"Runtime version",[52,72,57],{},[52,74,57],{},[52,76,57],{},[52,78,79],{},"Not guaranteed",[52,81,79],{},[25,83,84,87,89,91,94,97],{},[52,85,86],{},"Environment variables",[52,88,57],{},[52,90,57],{},[52,92,93],{},"With permission",[52,95,96],{},"No",[52,98,96],{},[25,100,101,104,106,108,110,112],{},[52,102,103],{},"User arguments",[52,105,57],{},[52,107,57],{},[52,109,57],{},[52,111,96],{},[52,113,96],{},[25,115,116,119,121,123,125,127],{},[52,117,118],{},"Current directory",[52,120,57],{},[52,122,57],{},[52,124,93],{},[52,126,96],{},[52,128,96],{},[25,130,131,134,137,139,141,143],{},[52,132,133],{},"Fetch",[52,135,136],{},"Version-dependent",[52,138,57],{},[52,140,57],{},[52,142,57],{},[52,144,57],{},[25,146,147,150,152,154,156,158],{},[52,148,149],{},"Timers and URL",[52,151,57],{},[52,153,57],{},[52,155,57],{},[52,157,57],{},[52,159,57],{},[25,161,162,165,167,169,171,173],{},[52,163,164],{},"Web Streams",[52,166,136],{},[52,168,57],{},[52,170,57],{},[52,172,57],{},[52,174,57],{},[176,177,178],"p",{},"The table describes the general model. Web-standard globals are checked at runtime because availability also depends on the runtime version and execution context.",[14,180,33],{"id":181},"nodejs",[176,183,184,185,189,190,193],{},"Node.js is detected through ",[186,187,188],"code",{},"process.versions.node",", which also provides its version. Environment variables, arguments, and the current directory use ",[186,191,192],{},"process",".",[14,195,36],{"id":196},"bun",[176,198,199,200,203,204,207,208,193],{},"Bun is checked before Node.js because it also exposes Node-compatible APIs. Its version comes from ",[186,201,202],{},"Bun.version",", its environment from ",[186,205,206],{},"Bun.env",", and its arguments and current directory from ",[186,209,192],{},[14,211,39],{"id":212},"deno",[176,214,215,216,218,219,222,223,193],{},"Deno is detected through the ",[186,217,39],{}," global and ",[186,220,221],{},"Deno.version.deno",". Environment and current-directory access may require permissions. See the ",[224,225,227],"a",{"href":226},"\u002Fguides\u002Fdeno-permissions","Deno permissions guide",[14,229,231],{"id":230},"cloudflare-workers-and-workerd","Cloudflare Workers and workerd",[176,233,234,236],{},[186,235,42],{}," is identified from the platform user agent. Processes, CLI arguments, and current directories do not exist in this model:",[238,239,244],"pre",{"className":240,"code":241,"language":242,"meta":243,"style":243},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","runtime.getEnv('KEY') \u002F\u002F undefined\nruntime.getEnv()      \u002F\u002F {}\nruntime.cwd()         \u002F\u002F undefined\nruntime.argv()        \u002F\u002F []\n","ts","",[186,245,246,281,296,311],{"__ignoreMap":243},[247,248,251,255,258,262,265,268,272,274,277],"span",{"class":249,"line":250},"line",1,[247,252,254],{"class":253},"sTEyZ","runtime",[247,256,193],{"class":257},"sMK4o",[247,259,261],{"class":260},"s2Zo4","getEnv",[247,263,264],{"class":253},"(",[247,266,267],{"class":257},"'",[247,269,271],{"class":270},"sfazB","KEY",[247,273,267],{"class":257},[247,275,276],{"class":253},") ",[247,278,280],{"class":279},"sHwdD","\u002F\u002F undefined\n",[247,282,284,286,288,290,293],{"class":249,"line":283},2,[247,285,254],{"class":253},[247,287,193],{"class":257},[247,289,261],{"class":260},[247,291,292],{"class":253},"()      ",[247,294,295],{"class":279},"\u002F\u002F {}\n",[247,297,299,301,303,306,309],{"class":249,"line":298},3,[247,300,254],{"class":253},[247,302,193],{"class":257},[247,304,305],{"class":260},"cwd",[247,307,308],{"class":253},"()         ",[247,310,280],{"class":279},[247,312,314,316,318,321,324],{"class":249,"line":313},4,[247,315,254],{"class":253},[247,317,193],{"class":257},[247,319,320],{"class":260},"argv",[247,322,323],{"class":253},"()        ",[247,325,326],{"class":279},"\u002F\u002F []\n",[14,328,45],{"id":329},"browser",[176,331,332,333,336,337,340,341,193],{},"A browser is identified when ",[186,334,335],{},"window"," and ",[186,338,339],{},"document"," exist. A Web Worker without a window may be returned as ",[186,342,343],{},"unknown",[14,345,347],{"id":346},"unknown-environments","Unknown environments",[176,349,350,351,353],{},"By default, an unrecognized environment produces ",[186,352,343],{}," and a neutral adapter. Use strict mode when continuing would be unsafe:",[238,355,357],{"className":240,"code":356,"language":242,"meta":243,"style":243},"const runtime = createRuntimeAdapter({ throwOnUnknown: true })\n",[186,358,359],{"__ignoreMap":243},[247,360,361,365,368,371,374,376,379,383,386,390,393],{"class":249,"line":250},[247,362,364],{"class":363},"spNyl","const",[247,366,367],{"class":253}," runtime ",[247,369,370],{"class":257},"=",[247,372,373],{"class":260}," createRuntimeAdapter",[247,375,264],{"class":253},[247,377,378],{"class":257},"{",[247,380,382],{"class":381},"swJcz"," throwOnUnknown",[247,384,385],{"class":257},":",[247,387,389],{"class":388},"sfNiH"," true",[247,391,392],{"class":257}," }",[247,394,395],{"class":253},")\n",[14,397,399],{"id":398},"version-policy","Version policy",[176,401,402],{},"The library targets modern runtimes that provide the required Web standards. Capabilities are checked at runtime rather than inferred solely from a version number.",[404,405,406],"style",{},"html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":243,"searchDepth":250,"depth":283,"links":408},[409,410,411,412,413,414,415,416],{"id":16,"depth":283,"text":17},{"id":181,"depth":283,"text":33},{"id":196,"depth":283,"text":36},{"id":212,"depth":283,"text":39},{"id":230,"depth":283,"text":231},{"id":329,"depth":283,"text":45},{"id":346,"depth":283,"text":347},{"id":398,"depth":283,"text":399},"Understand what is available in Node.js, Bun, Deno, workerd, and browsers.","md",null,{},true,"\u002Fgetting-started\u002Fruntime-support",{"title":5,"description":417},"1.getting-started\u002F4.runtime-support","Q-1jOoScJng3ERAIddg7SMoQvIdE403FHjiNMJrKiMY",[427,432],{"title":428,"path":429,"stem":430,"description":431,"children":-1},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","Detect the runtime and start using the main APIs in a few minutes.",{"title":433,"path":434,"stem":435,"description":436,"children":-1},"Runtime detection","\u002Fcore-concepts\u002Fruntime-detection","2.core-concepts\u002F1.runtime-detection","Learn how detectRuntime() works, including priority order and strict mode.",[438,452,472,489,510],{"title":439,"path":440,"stem":441,"children":442,"icon":451},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[443,445,449,450],{"title":444,"path":440,"stem":441},"Introduction",{"title":446,"path":447,"stem":448},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":428,"path":429,"stem":430},{"title":5,"path":422,"stem":424},"i-lucide-rocket",{"title":453,"icon":454,"path":455,"stem":456,"children":457,"page":471},"Core concepts","i-lucide-box","\u002Fcore-concepts","2.core-concepts",[458,459,463,467],{"title":433,"path":434,"stem":435},{"title":460,"path":461,"stem":462},"Runtime adapter","\u002Fcore-concepts\u002Fruntime-adapter","2.core-concepts\u002F2.runtime-adapter",{"title":464,"path":465,"stem":466},"Capabilities","\u002Fcore-concepts\u002Fcapabilities","2.core-concepts\u002F3.capabilities",{"title":468,"path":469,"stem":470},"Error handling","\u002Fcore-concepts\u002Ferrors","2.core-concepts\u002F4.errors",false,{"title":473,"icon":474,"path":475,"stem":476,"children":477,"page":471},"Utilities","i-lucide-wrench","\u002Futilities","3.utilities",[478,481,485],{"title":133,"path":479,"stem":480},"\u002Futilities\u002Ffetch","3.utilities\u002F1.fetch",{"title":482,"path":483,"stem":484},"Timers","\u002Futilities\u002Ftimers","3.utilities\u002F2.timers",{"title":486,"path":487,"stem":488},"URL","\u002Futilities\u002Furl","3.utilities\u002F3.url",{"title":490,"icon":491,"path":492,"stem":493,"children":494,"page":471},"Guides","i-lucide-graduation-cap","\u002Fguides","4.guides",[495,498,502,506],{"title":496,"path":226,"stem":497},"Deno permissions","4.guides\u002F1.deno-permissions",{"title":499,"path":500,"stem":501},"Conditional code","\u002Fguides\u002Fconditional-code","4.guides\u002F2.conditional-code",{"title":503,"path":504,"stem":505},"Testing multiple runtimes","\u002Fguides\u002Ftesting","4.guides\u002F3.testing",{"title":507,"path":508,"stem":509},"Frequently asked questions","\u002Fguides\u002Ffaq","4.guides\u002F4.faq",{"title":511,"icon":512,"path":513,"stem":514,"children":515,"page":471},"Reference","i-lucide-book-open","\u002Freference","5.reference",[516,520,524],{"title":517,"path":518,"stem":519},"API reference","\u002Freference\u002Fapi","5.reference\u002F1.api",{"title":521,"path":522,"stem":523},"Scope and design decisions","\u002Freference\u002Fscope","5.reference\u002F2.scope",{"title":525,"path":526,"stem":527},"Roadmap","\u002Freference\u002Froadmap","5.reference\u002F3.roadmap",1796297154601,"7c446e43-2e3e-4ee5-9931-1c6979897184"]