[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$KiqIp5Qu8t":3,"vue-tips-\u002Fvue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally":52,"blogToc-\u002Fvue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally":256,"vue-tips-surrounding-\u002Fvue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally":378},{"id":4,"extension":5,"items":6,"meta":49,"stem":50,"__hash__":51},"menu\u002Fmenu.json","json",[7,12,16,20,24,28,32,36,41,45],{"i18nId":8,"to":9,"ariaLabel":10,"mainNavigation":11},"components.menu.home","\u002F","Home",true,{"i18nId":13,"to":14,"ariaLabel":15,"mainNavigation":11},"components.menu.about","\u002Fhire-me","About",{"i18nId":17,"to":18,"ariaLabel":19,"mainNavigation":11},"components.menu.testimonials","\u002Ftestimonials","Testimonials",{"i18nId":21,"to":22,"ariaLabel":23},"components.menu.contact","\u002Fcontact","Contact",{"i18nId":25,"to":26,"ariaLabel":27,"mainNavigation":11},"components.menu.blog","\u002Fblog","Blog",{"i18nId":29,"to":30,"ariaLabel":31,"mainNavigation":11},"components.menu.tips","\u002Fvue-tips","Vue Tips",{"i18nId":33,"to":34,"ariaLabel":35,"mainNavigation":11},"components.menu.projects","\u002Fprojects","Projects",{"i18nId":37,"to":38,"ariaLabel":39,"mainNavigation":40},"components.menu.stats","\u002Fstats","stats",false,{"i18nId":42,"to":43,"ariaLabel":44,"mainNavigation":40},"components.menu.businessCard","\u002Fbusiness-card","Business Card",{"i18nId":46,"to":47,"ariaLabel":48,"mainNavigation":40},"components.menu.publications","\u002Fpublications","Publications",{},"menu","njLT1QoRt2Dv8QWoVmH8xdTAiDywSj0bxBQdmoyWUE0",{"id":53,"title":54,"body":55,"categories":238,"cover":240,"date":241,"description":242,"extension":243,"lastUpdated":244,"meta":245,"navigation":11,"ogImage":244,"path":246,"readingTime":247,"robots":244,"schemaOrg":244,"seo":252,"sitemap":253,"stem":254,"tags":244,"__hash__":255},"vueTips\u002Fvue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally\u002Findex.md","Nuxt Tip: How Nuxt Uses Nitro, h3 and ofetch Internally",{"type":56,"value":57,"toc":230},"minimark",[58,83,88,97,103,112,114,126,131,134,148,150,160,162,186,189,202,204,215],[59,60,61,62,69,70,74,75,78,79,82],"p",{},"If you are using ",[63,64,68],"a",{"href":65,"rel":66},"https:\u002F\u002Fnuxt.com\u002F",[67],"nofollow","Nuxt 3"," you might stumble upon one of the following tools: ",[71,72,73],"code",{},"Nitro",", ",[71,76,77],{},"h3"," or ",[71,80,81],{},"ofetch",". I often see that people are confused by these tools, so let me clarify their responsibility and how Nuxt uses them internally.",[84,85,87],"h2",{"id":86},"unjs","UnJS",[59,89,90,91,96],{},"All of the following packages are published in the ",[63,92,95],{"href":93,"rel":94},"https:\u002F\u002Funjs.io\u002F",[67],"UnJS ecosystem",". The philosophy is",[98,99,100],"blockquote",{},[59,101,102],{},"A robust ecosystem, driven by the UNIX Philosophy, housing purpose-built, high-quality JavaScript utilities, libraries, and tools, upheld by a collaborative community.",[59,104,105,106,111],{},"The ecosystem provides ",[63,107,110],{"href":108,"rel":109},"https:\u002F\u002Funjs.io\u002Fpackages?q=&order=1&orderBy=title",[67],"56+ packages",".",[84,113,81],{"id":81},[59,115,116,117,121,122,125],{},"Nuxt provides access to ",[63,118,81],{"href":119,"rel":120},"https:\u002F\u002Fgithub.com\u002Funjs\u002Fofetch",[67]," via the ",[71,123,124],{},"$fetch"," API. Its described as",[98,127,128],{},[59,129,130],{},"A better fetch API. Works on node, browser, and workers.",[59,132,133],{},"Some of its key features:",[135,136,137,141],"ul",{},[138,139,140],"li",{},"Smartly parsing JSON responses (with access to raw response if needed).",[138,142,143,144,147],{},"Request body and params are automatically handled, with correct ",[71,145,146],{},"Content-Type"," headers.",[84,149,77],{"id":77},[59,151,152,156,157,111],{},[63,153,77],{"href":154,"rel":155},"https:\u002F\u002Fgithub.com\u002Funjs\u002Fh3",[67]," is an ",[71,158,159],{},"H(TTP) server framework built for high performance and portability running in any JavaScript runtime",[59,161,133],{},[135,163,164,174,183],{},[138,165,166,167,170,171,173],{},"Event handlers automatically convert responses. For example, if you return a JSON object it will be stringified and sent with the default ",[71,168,169],{},"application\u002Fjson"," ",[71,172,146],{}," header.",[138,175,176,177,74,180,182],{},"If an event handler returns a ",[71,178,179],{},"Promise",[71,181,77],{}," will wait for it before it sends the response.",[138,184,185],{},"A set of useful helper functions for body parsing, cookie handling, redirects, headers and more.",[84,187,73],{"id":188},"nitro",[59,190,191,195,196,198,199,111],{},[63,192,73],{"href":193,"rel":194},"https:\u002F\u002Fnitro.unjs.io\u002F",[67]," uses ",[71,197,77],{}," internally and is a server toolkit to ",[71,200,201],{},"create web servers with everything you need and deploy them wherever you prefer",[59,203,133],{},[135,205,206,209,212],{},[138,207,208],{},"Cross-platform support for Node.js, Browsers, service-workers and more.",[138,210,211],{},"Support for API routes, middleware, and more.",[138,213,214],{},"Development server with hot module reloading.",[59,216,217,218,223,224,229],{},"Nitro powers the server ",[63,219,222],{"href":220,"rel":221},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fguide\u002Fdirectory-structure\u002Fserver#api-routes",[67],"API endpoints"," and ",[63,225,228],{"href":226,"rel":227},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fguide\u002Fdirectory-structure\u002Fserver#server-middleware",[67],"middleware"," in Nuxt 3.",{"title":231,"searchDepth":232,"depth":232,"links":233},"",2,[234,235,236,237],{"id":86,"depth":232,"text":87},{"id":81,"depth":232,"text":81},{"id":77,"depth":232,"text":77},{"id":188,"depth":232,"text":73},[239],"nuxt","vue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally\u002Fog.png","2024-03-01","Nitro, h3 and ofetch are UnJS packages that are used to power the Nuxt 3 server engine.","md",null,{},"\u002Fvue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally",{"text":248,"minutes":249,"time":250,"words":251},"2 min read",1.09,65400,218,{"title":54,"description":242},{"loc":246,"lastmod":241},"vue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally\u002Findex","G-wbC1SSDaDlANpcYveIvuCyB7KJBVlKzqdi7cS1n-s",{"id":257,"title":54,"body":258,"cover":240,"description":242,"extension":243,"meta":372,"navigation":11,"path":246,"robots":244,"seo":375,"sitemap":376,"stem":254,"__hash__":377},"content\u002Fvue-tips\u002Fhow-nuxt-uses-nitro-h3-and-ofetch-internally\u002Findex.md",{"type":56,"value":259,"toc":366},[260,271,273,278,282,287,289,296,300,302,310,312,319,321,337,339,348,350,358],[59,261,61,262,69,265,74,267,78,269,82],{},[63,263,68],{"href":65,"rel":264},[67],[71,266,73],{},[71,268,77],{},[71,270,81],{},[84,272,87],{"id":86},[59,274,90,275,96],{},[63,276,95],{"href":93,"rel":277},[67],[98,279,280],{},[59,281,102],{},[59,283,105,284,111],{},[63,285,110],{"href":108,"rel":286},[67],[84,288,81],{"id":81},[59,290,116,291,121,294,125],{},[63,292,81],{"href":119,"rel":293},[67],[71,295,124],{},[98,297,298],{},[59,299,130],{},[59,301,133],{},[135,303,304,306],{},[138,305,140],{},[138,307,143,308,147],{},[71,309,146],{},[84,311,77],{"id":77},[59,313,314,156,317,111],{},[63,315,77],{"href":154,"rel":316},[67],[71,318,159],{},[59,320,133],{},[135,322,323,329,335],{},[138,324,166,325,170,327,173],{},[71,326,169],{},[71,328,146],{},[138,330,176,331,74,333,182],{},[71,332,179],{},[71,334,77],{},[138,336,185],{},[84,338,73],{"id":188},[59,340,341,195,344,198,346,111],{},[63,342,73],{"href":193,"rel":343},[67],[71,345,77],{},[71,347,201],{},[59,349,133],{},[135,351,352,354,356],{},[138,353,208],{},[138,355,211],{},[138,357,214],{},[59,359,217,360,223,363,229],{},[63,361,222],{"href":220,"rel":362},[67],[63,364,228],{"href":226,"rel":365},[67],{"title":231,"searchDepth":232,"depth":232,"links":367},[368,369,370,371],{"id":86,"depth":232,"text":87},{"id":81,"depth":232,"text":81},{"id":77,"depth":232,"text":77},{"id":188,"depth":232,"text":73},{"categories":373,"date":241,"readingTime":374},[239],{"text":248,"minutes":249,"time":250,"words":251},{"title":54,"description":242},{"loc":246,"lastmod":241},"0DHmDsVAjUhF0E0IFPnkZpZTSJDY8j6Ks8qhptpyE70",[379,383],{"title":380,"path":381,"stem":382,"children":-1},"Vue Tip: Validate Props in Script Setup With TypeScript","\u002Fvue-tips\u002Fvalidate-props-in-script-setup-with-type-script","vue-tips\u002Fvalidate-props-in-script-setup-with-type-script\u002Findex",{"title":384,"path":385,"stem":386,"children":-1},"Vue Tip: Don't Use Reactive Object for Template Refs","\u002Fvue-tips\u002Fdont-use-reactive-object-for-template-refs","vue-tips\u002Fdont-use-reactive-object-for-template-refs\u002Findex"]