[{"data":1,"prerenderedAt":549,"buildId":550},["ShallowReactive",2],{"\u002Fgetting-started":3,"\u002Fgetting-started-surround":456,"navigation":461},{"id":4,"title":5,"body":6,"description":448,"extension":449,"links":450,"meta":451,"navigation":234,"path":452,"seo":453,"stem":454,"__hash__":455},"docs\u002F1.getting-started\u002F1.index.md","Introduction",{"type":7,"value":8,"toc":441},"minimark",[9,13,21,34,39,126,130,166,170,175,178,182,410,414,437],[10,11,5],"h1",{"id":12},"introduction",[14,15,16,20],"p",{},[17,18,19],"code",{},"oruntime"," is an ESM TypeScript library that provides compatibility primitives across JavaScript environments. It answers three questions:",[22,23,24,28,31],"ol",{},[25,26,27],"li",{},"Which runtime is executing my code?",[25,29,30],{},"Which capabilities are actually available?",[25,32,33],{},"How can common features be used with consistent behavior?",[35,36,38],"h2",{"id":37},"supported-runtimes","Supported runtimes",[40,41,42,55],"table",{},[43,44,45],"thead",{},[46,47,48,52],"tr",{},[49,50,51],"th",{},"Runtime",[49,53,54],{},"Description",[56,57,58,69,79,89,99,116],"tbody",{},[46,59,60,66],{},[61,62,63],"td",{},[17,64,65],{},"node",[61,67,68],{},"Node.js",[46,70,71,76],{},[61,72,73],{},[17,74,75],{},"bun",[61,77,78],{},"Bun",[46,80,81,86],{},[61,82,83],{},[17,84,85],{},"deno",[61,87,88],{},"Deno",[46,90,91,96],{},[61,92,93],{},[17,94,95],{},"workerd",[61,97,98],{},"Cloudflare Workers and workerd environments",[46,100,101,106],{},[61,102,103],{},[17,104,105],{},"browser",[61,107,108,109,112,113],{},"A browser window with ",[17,110,111],{},"window"," and ",[17,114,115],{},"document",[46,117,118,123],{},[61,119,120],{},[17,121,122],{},"unknown",[61,124,125],{},"An unrecognized environment",[35,127,129],{"id":128},"what-oruntime-provides","What oruntime provides",[131,132,133,142,150,158],"card-group",{},[134,135,139],"card",{"icon":136,"title":137,"to":138},"i-lucide-radar","Detection","\u002Fcore-concepts\u002Fruntime-detection",[14,140,141],{},"Identify the runtime without accessing privileged APIs.",[134,143,147],{"icon":144,"title":145,"to":146},"i-lucide-plug","Adapter","\u002Fcore-concepts\u002Fruntime-adapter",[14,148,149],{},"Read the version, environment, arguments, and current directory.",[134,151,155],{"icon":152,"title":153,"to":154},"i-lucide-list-checks","Capabilities","\u002Fcore-concepts\u002Fcapabilities",[14,156,157],{},"Check whether APIs are available before calling them.",[134,159,163],{"icon":160,"title":161,"to":162},"i-lucide-wrench","Portable utilities","\u002Futilities\u002Ffetch",[14,164,165],{},"Use Fetch, timeouts, cancellation, and URLs through a consistent API.",[35,167,169],{"id":168},"philosophy","Philosophy",[14,171,172,174],{},[17,173,19],{}," favors Web standards and APIs that already work across runtimes. It does not wrap an existing shared standard or replace specialized solutions.",[14,176,177],{},"Capability detection confirms that an API exists. It does not guarantee that permissions, platform policies, or configuration will allow a particular operation.",[35,179,181],{"id":180},"minimal-example","Minimal example",[183,184,189],"pre",{"className":185,"code":186,"language":187,"meta":188,"style":188},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createRuntimeAdapter, fetchJSON } from 'oruntime'\n\nconst runtime = createRuntimeAdapter()\nconsole.log(`Runtime: ${runtime.name} ${runtime.version ?? ''}`)\n\nif (runtime.capabilities.fetch) {\n  const status = await fetchJSON\u003C{ ok: boolean }>('https:\u002F\u002Fexample.com\u002Fstatus')\n  console.log(status.ok)\n}\n","ts","",[17,190,191,229,236,255,309,314,336,382,404],{"__ignoreMap":188},[192,193,196,200,204,208,211,214,217,220,223,226],"span",{"class":194,"line":195},"line",1,[192,197,199],{"class":198},"s7zQu","import",[192,201,203],{"class":202},"sMK4o"," {",[192,205,207],{"class":206},"sTEyZ"," createRuntimeAdapter",[192,209,210],{"class":202},",",[192,212,213],{"class":206}," fetchJSON",[192,215,216],{"class":202}," }",[192,218,219],{"class":198}," from",[192,221,222],{"class":202}," '",[192,224,19],{"class":225},"sfazB",[192,227,228],{"class":202},"'\n",[192,230,232],{"class":194,"line":231},2,[192,233,235],{"emptyLinePlaceholder":234},true,"\n",[192,237,239,243,246,249,252],{"class":194,"line":238},3,[192,240,242],{"class":241},"spNyl","const",[192,244,245],{"class":206}," runtime ",[192,247,248],{"class":202},"=",[192,250,207],{"class":251},"s2Zo4",[192,253,254],{"class":206},"()\n",[192,256,258,261,264,267,270,273,276,279,282,284,287,290,293,295,297,300,303,306],{"class":194,"line":257},4,[192,259,260],{"class":206},"console",[192,262,263],{"class":202},".",[192,265,266],{"class":251},"log",[192,268,269],{"class":206},"(",[192,271,272],{"class":202},"`",[192,274,275],{"class":225},"Runtime: ",[192,277,278],{"class":202},"${",[192,280,281],{"class":206},"runtime",[192,283,263],{"class":202},[192,285,286],{"class":206},"name",[192,288,289],{"class":202},"}",[192,291,292],{"class":202}," ${",[192,294,281],{"class":206},[192,296,263],{"class":202},[192,298,299],{"class":206},"version ",[192,301,302],{"class":202},"??",[192,304,305],{"class":202}," ''}`",[192,307,308],{"class":206},")\n",[192,310,312],{"class":194,"line":311},5,[192,313,235],{"emptyLinePlaceholder":234},[192,315,317,320,323,325,328,330,333],{"class":194,"line":316},6,[192,318,319],{"class":198},"if",[192,321,322],{"class":206}," (runtime",[192,324,263],{"class":202},[192,326,327],{"class":206},"capabilities",[192,329,263],{"class":202},[192,331,332],{"class":206},"fetch) ",[192,334,335],{"class":202},"{\n",[192,337,339,342,345,348,351,353,356,360,363,367,370,372,375,378,380],{"class":194,"line":338},7,[192,340,341],{"class":241},"  const",[192,343,344],{"class":206}," status",[192,346,347],{"class":202}," =",[192,349,350],{"class":198}," await",[192,352,213],{"class":251},[192,354,355],{"class":202},"\u003C{",[192,357,359],{"class":358},"swJcz"," ok",[192,361,362],{"class":202},":",[192,364,366],{"class":365},"sBMFI"," boolean",[192,368,369],{"class":202}," }>",[192,371,269],{"class":358},[192,373,374],{"class":202},"'",[192,376,377],{"class":225},"https:\u002F\u002Fexample.com\u002Fstatus",[192,379,374],{"class":202},[192,381,308],{"class":358},[192,383,385,388,390,392,394,397,399,402],{"class":194,"line":384},8,[192,386,387],{"class":206},"  console",[192,389,263],{"class":202},[192,391,266],{"class":251},[192,393,269],{"class":358},[192,395,396],{"class":206},"status",[192,398,263],{"class":202},[192,400,401],{"class":206},"ok",[192,403,308],{"class":358},[192,405,407],{"class":194,"line":406},9,[192,408,409],{"class":202},"}\n",[35,411,413],{"id":412},"next-steps","Next steps",[22,415,416,423,430],{},[25,417,418,263],{},[419,420,422],"a",{"href":421},"\u002Fgetting-started\u002Finstallation","Install the package",[25,424,425,426,263],{},"Follow the ",[419,427,429],{"href":428},"\u002Fgetting-started\u002Fquick-start","quick start",[25,431,432,433,263],{},"Review ",[419,434,436],{"href":435},"\u002Fgetting-started\u002Fruntime-support","runtime support",[438,439,440],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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);}",{"title":188,"searchDepth":195,"depth":231,"links":442},[443,444,445,446,447],{"id":37,"depth":231,"text":38},{"id":128,"depth":231,"text":129},{"id":168,"depth":231,"text":169},{"id":180,"depth":231,"text":181},{"id":412,"depth":231,"text":413},"Learn what oruntime does, which runtimes it targets, and the principles behind its API.","md",null,{},"\u002Fgetting-started",{"title":5,"description":448},"1.getting-started\u002F1.index","dMoYuf3geK3HfSGVFBLlZUrP7sOQZ33wfFB7k0ur_mE",[450,457],{"title":458,"path":421,"stem":459,"description":460,"children":-1},"Installation","1.getting-started\u002F2.installation","Install oruntime and configure your TypeScript or JavaScript project.",[462,474,493,509,531],{"title":463,"path":452,"stem":454,"children":464,"icon":473},"Getting started",[465,466,467,470],{"title":5,"path":452,"stem":454},{"title":458,"path":421,"stem":459},{"title":468,"path":428,"stem":469},"Quick start","1.getting-started\u002F3.quick-start",{"title":471,"path":435,"stem":472},"Runtime support","1.getting-started\u002F4.runtime-support","i-lucide-rocket",{"title":475,"icon":476,"path":477,"stem":478,"children":479,"page":492},"Core concepts","i-lucide-box","\u002Fcore-concepts","2.core-concepts",[480,483,486,488],{"title":481,"path":138,"stem":482},"Runtime detection","2.core-concepts\u002F1.runtime-detection",{"title":484,"path":146,"stem":485},"Runtime adapter","2.core-concepts\u002F2.runtime-adapter",{"title":153,"path":154,"stem":487},"2.core-concepts\u002F3.capabilities",{"title":489,"path":490,"stem":491},"Error handling","\u002Fcore-concepts\u002Ferrors","2.core-concepts\u002F4.errors",false,{"title":494,"icon":160,"path":495,"stem":496,"children":497,"page":492},"Utilities","\u002Futilities","3.utilities",[498,501,505],{"title":499,"path":162,"stem":500},"Fetch","3.utilities\u002F1.fetch",{"title":502,"path":503,"stem":504},"Timers","\u002Futilities\u002Ftimers","3.utilities\u002F2.timers",{"title":506,"path":507,"stem":508},"URL","\u002Futilities\u002Furl","3.utilities\u002F3.url",{"title":510,"icon":511,"path":512,"stem":513,"children":514,"page":492},"Guides","i-lucide-graduation-cap","\u002Fguides","4.guides",[515,519,523,527],{"title":516,"path":517,"stem":518},"Deno permissions","\u002Fguides\u002Fdeno-permissions","4.guides\u002F1.deno-permissions",{"title":520,"path":521,"stem":522},"Conditional code","\u002Fguides\u002Fconditional-code","4.guides\u002F2.conditional-code",{"title":524,"path":525,"stem":526},"Testing multiple runtimes","\u002Fguides\u002Ftesting","4.guides\u002F3.testing",{"title":528,"path":529,"stem":530},"Frequently asked questions","\u002Fguides\u002Ffaq","4.guides\u002F4.faq",{"title":532,"icon":533,"path":534,"stem":535,"children":536,"page":492},"Reference","i-lucide-book-open","\u002Freference","5.reference",[537,541,545],{"title":538,"path":539,"stem":540},"API reference","\u002Freference\u002Fapi","5.reference\u002F1.api",{"title":542,"path":543,"stem":544},"Scope and design decisions","\u002Freference\u002Fscope","5.reference\u002F2.scope",{"title":546,"path":547,"stem":548},"Roadmap","\u002Freference\u002Froadmap","5.reference\u002F3.roadmap",1796297154601,"7c446e43-2e3e-4ee5-9931-1c6979897184"]