[{"data":1,"prerenderedAt":2049},["ShallowReactive",2],{"navigation":3,"-docs-tasks":407,"-docs-tasks-surround":2044},[4,93,226,232,392,404],{"title":5,"path":6,"stem":7,"children":8,"icon":92},"","\u002Fdocs","1.docs\u002F1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82,87],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","\u002Fdocs\u002Fquick-start","1.docs\u002F2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","\u002Fdocs\u002Frenderer","1.docs\u002F4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","\u002Fdocs\u002Frouting","1.docs\u002F5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","\u002Fdocs\u002Fassets","1.docs\u002F50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","\u002Fdocs\u002Fconfiguration","1.docs\u002F50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","\u002Fdocs\u002Fdatabase","1.docs\u002F50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","\u002Fdocs\u002Flifecycle","1.docs\u002F50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"OpenAPI","\u002Fdocs\u002Fopenapi","1.docs\u002F50.openapi","ri:contract-line",{"title":53,"path":54,"stem":55,"icon":56},"Plugins","\u002Fdocs\u002Fplugins","1.docs\u002F50.plugins","ri:plug-line",{"title":58,"path":59,"stem":60,"icon":61},"Tasks","\u002Fdocs\u002Ftasks","1.docs\u002F50.tasks","codicon:run-all",{"title":63,"path":64,"stem":65,"icon":66},"WebSocket","\u002Fdocs\u002Fwebsocket","1.docs\u002F50.websocket","ri:broadcast-fill",{"title":68,"path":69,"stem":70,"icon":71},"Server Entry","\u002Fdocs\u002Fserver-entry","1.docs\u002F6.server-entry","ri:server-line",{"title":73,"path":74,"stem":75,"icon":76},"Cache","\u002Fdocs\u002Fcache","1.docs\u002F7.cache","ri:speed-line",{"title":78,"path":79,"stem":80,"icon":81},"KV Storage","\u002Fdocs\u002Fstorage","1.docs\u002F8.storage","carbon:datastore",{"title":83,"path":84,"stem":85,"icon":86},"Migration Guide","\u002Fdocs\u002Fmigration","1.docs\u002F99.migration","ri:arrow-right-up-line",{"title":88,"path":89,"stem":90,"icon":91},"Nightly Channel","\u002Fdocs\u002Fnightly","1.docs\u002F99.nightly","ri:moon-fill","i-lucide-book-open",{"title":94,"path":95,"stem":96,"children":97,"icon":99},"Deploy","\u002Fdeploy","2.deploy\u002F0.index",[98,100,121],{"title":94,"path":95,"stem":96,"icon":99},"ri:upload-cloud-2-line",{"title":101,"path":102,"stem":103,"children":104,"page":120},"Runtimes","\u002Fdeploy\u002Fruntimes","2.deploy\u002F10.runtimes",[105,110,115],{"title":106,"path":107,"stem":108,"icon":109},"Node.js","\u002Fdeploy\u002Fruntimes\u002Fnode","2.deploy\u002F10.runtimes\u002F1.node","akar-icons:node-fill",{"title":111,"path":112,"stem":113,"icon":114},"Bun","\u002Fdeploy\u002Fruntimes\u002Fbun","2.deploy\u002F10.runtimes\u002Fbun","simple-icons:bun",{"title":116,"path":117,"stem":118,"icon":119},"Deno","\u002Fdeploy\u002Fruntimes\u002Fdeno","2.deploy\u002F10.runtimes\u002Fdeno","simple-icons:deno",false,{"title":122,"path":123,"stem":124,"children":125,"page":120},"Providers","\u002Fdeploy\u002Fproviders","2.deploy\u002F20.providers",[126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222],{"title":127,"path":128,"stem":129},"Alwaysdata","\u002Fdeploy\u002Fproviders\u002Falwaysdata","2.deploy\u002F20.providers\u002Falwaysdata",{"title":131,"path":132,"stem":133},"AWS Lambda","\u002Fdeploy\u002Fproviders\u002Faws","2.deploy\u002F20.providers\u002Faws",{"title":135,"path":136,"stem":137},"AWS Amplify","\u002Fdeploy\u002Fproviders\u002Faws-amplify","2.deploy\u002F20.providers\u002Faws-amplify",{"title":139,"path":140,"stem":141},"Azure","\u002Fdeploy\u002Fproviders\u002Fazure","2.deploy\u002F20.providers\u002Fazure",{"title":143,"path":144,"stem":145},"Cleavr","\u002Fdeploy\u002Fproviders\u002Fcleavr","2.deploy\u002F20.providers\u002Fcleavr",{"title":147,"path":148,"stem":149},"Cloudflare","\u002Fdeploy\u002Fproviders\u002Fcloudflare","2.deploy\u002F20.providers\u002Fcloudflare",{"title":151,"path":152,"stem":153},"Deno Deploy","\u002Fdeploy\u002Fproviders\u002Fdeno-deploy","2.deploy\u002F20.providers\u002Fdeno-deploy",{"title":155,"path":156,"stem":157},"DigitalOcean","\u002Fdeploy\u002Fproviders\u002Fdigitalocean","2.deploy\u002F20.providers\u002Fdigitalocean",{"title":159,"path":160,"stem":161},"EdgeOne Pages","\u002Fdeploy\u002Fproviders\u002Fedgeone","2.deploy\u002F20.providers\u002Fedgeone",{"title":163,"path":164,"stem":165},"Firebase","\u002Fdeploy\u002Fproviders\u002Ffirebase","2.deploy\u002F20.providers\u002Ffirebase",{"title":167,"path":168,"stem":169},"Flightcontrol","\u002Fdeploy\u002Fproviders\u002Fflightcontrol","2.deploy\u002F20.providers\u002Fflightcontrol",{"title":171,"path":172,"stem":173},"Genezio","\u002Fdeploy\u002Fproviders\u002Fgenezio","2.deploy\u002F20.providers\u002Fgenezio",{"title":175,"path":176,"stem":177},"GitHub Pages","\u002Fdeploy\u002Fproviders\u002Fgithub-pages","2.deploy\u002F20.providers\u002Fgithub-pages",{"title":179,"path":180,"stem":181},"GitLab Pages","\u002Fdeploy\u002Fproviders\u002Fgitlab-pages","2.deploy\u002F20.providers\u002Fgitlab-pages",{"title":183,"path":184,"stem":185},"Heroku","\u002Fdeploy\u002Fproviders\u002Fheroku","2.deploy\u002F20.providers\u002Fheroku",{"title":187,"path":188,"stem":189},"IIS","\u002Fdeploy\u002Fproviders\u002Fiis","2.deploy\u002F20.providers\u002Fiis",{"title":191,"path":192,"stem":193},"Koyeb","\u002Fdeploy\u002Fproviders\u002Fkoyeb","2.deploy\u002F20.providers\u002Fkoyeb",{"title":195,"path":196,"stem":197},"Netlify","\u002Fdeploy\u002Fproviders\u002Fnetlify","2.deploy\u002F20.providers\u002Fnetlify",{"title":199,"path":200,"stem":201},"Platform.sh","\u002Fdeploy\u002Fproviders\u002Fplatform-sh","2.deploy\u002F20.providers\u002Fplatform-sh",{"title":203,"path":204,"stem":205},"Render.com","\u002Fdeploy\u002Fproviders\u002Frender","2.deploy\u002F20.providers\u002Frender",{"title":207,"path":208,"stem":209},"StormKit","\u002Fdeploy\u002Fproviders\u002Fstormkit","2.deploy\u002F20.providers\u002Fstormkit",{"title":211,"path":212,"stem":213},"Vercel","\u002Fdeploy\u002Fproviders\u002Fvercel","2.deploy\u002F20.providers\u002Fvercel",{"title":215,"path":216,"stem":217},"Zeabur","\u002Fdeploy\u002Fproviders\u002Fzeabur","2.deploy\u002F20.providers\u002Fzeabur",{"title":219,"path":220,"stem":221},"Zephyr Cloud","\u002Fdeploy\u002Fproviders\u002Fzephyr","2.deploy\u002F20.providers\u002Fzephyr",{"title":223,"path":224,"stem":225},"Zerops","\u002Fdeploy\u002Fproviders\u002Fzerops","2.deploy\u002F20.providers\u002Fzerops",{"title":227,"path":228,"stem":229,"children":230,"icon":36},"Config","\u002Fconfig","3.config\u002F0.index",[231],{"title":227,"path":228,"stem":229,"icon":36},{"title":233,"path":234,"stem":235,"children":236,"icon":238},"Examples","\u002Fexamples","4.examples\u002F0.index",[237,239,244,249,254,259,263,268,273,278,283,288,293,297,302,306,310,315,320,325,330,335,340,345,350,355,360,364,369,374,378,383,388],{"title":233,"path":234,"stem":235,"icon":238},"i-lucide-folder-code",{"title":240,"path":241,"stem":242,"icon":243},"API Routes","\u002Fexamples\u002Fapi-routes","4.examples\u002Fapi-routes","i-lucide-route",{"title":245,"path":246,"stem":247,"icon":248},"Auto Imports","\u002Fexamples\u002Fauto-imports","4.examples\u002Fauto-imports","i-lucide-import",{"title":250,"path":251,"stem":252,"icon":253},"Cached Handler","\u002Fexamples\u002Fcached-handler","4.examples\u002Fcached-handler","i-lucide-clock",{"title":255,"path":256,"stem":257,"icon":258},"Custom Error Handler","\u002Fexamples\u002Fcustom-error-handler","4.examples\u002Fcustom-error-handler","i-lucide-alert-circle",{"title":38,"path":260,"stem":261,"icon":262},"\u002Fexamples\u002Fdatabase","4.examples\u002Fdatabase","i-lucide-database",{"title":264,"path":265,"stem":266,"icon":267},"Elysia","\u002Fexamples\u002Felysia","4.examples\u002Felysia","i-skill-icons-elysia-dark",{"title":269,"path":270,"stem":271,"icon":272},"Express","\u002Fexamples\u002Fexpress","4.examples\u002Fexpress","i-simple-icons-express",{"title":274,"path":275,"stem":276,"icon":277},"Fastify","\u002Fexamples\u002Ffastify","4.examples\u002Ffastify","i-simple-icons-fastify",{"title":279,"path":280,"stem":281,"icon":282},"Hello World","\u002Fexamples\u002Fhello-world","4.examples\u002Fhello-world","i-lucide-sparkles",{"title":284,"path":285,"stem":286,"icon":287},"Hono","\u002Fexamples\u002Fhono","4.examples\u002Fhono","i-logos-hono",{"title":289,"path":290,"stem":291,"icon":292},"Import Alias","\u002Fexamples\u002Fimport-alias","4.examples\u002Fimport-alias","i-lucide-at-sign",{"title":294,"path":295,"stem":296,"icon":46},"Middleware","\u002Fexamples\u002Fmiddleware","4.examples\u002Fmiddleware",{"title":298,"path":299,"stem":300,"icon":301},"Mono JSX","\u002Fexamples\u002Fmono-jsx","4.examples\u002Fmono-jsx","i-lucide-brackets",{"title":303,"path":304,"stem":305,"icon":301},"Nano JSX","\u002Fexamples\u002Fnano-jsx","4.examples\u002Fnano-jsx",{"title":53,"path":307,"stem":308,"icon":309},"\u002Fexamples\u002Fplugins","4.examples\u002Fplugins","i-lucide-plug",{"title":311,"path":312,"stem":313,"icon":314},"Custom Renderer","\u002Fexamples\u002Frenderer","4.examples\u002Frenderer","i-lucide-code",{"title":316,"path":317,"stem":318,"icon":319},"Runtime Config","\u002Fexamples\u002Fruntime-config","4.examples\u002Fruntime-config","i-lucide-settings",{"title":321,"path":322,"stem":323,"icon":324},"Server Fetch","\u002Fexamples\u002Fserver-fetch","4.examples\u002Fserver-fetch","i-lucide-arrow-right-left",{"title":326,"path":327,"stem":328,"icon":329},"Shiki","\u002Fexamples\u002Fshiki","4.examples\u002Fshiki","i-lucide-highlighter",{"title":331,"path":332,"stem":333,"icon":334},"Takumi","\u002Fexamples\u002Ftakumi","4.examples\u002Ftakumi","i-lucide-image",{"title":336,"path":337,"stem":338,"icon":339},"Virtual Routes","\u002Fexamples\u002Fvirtual-routes","4.examples\u002Fvirtual-routes","i-lucide-box",{"title":341,"path":342,"stem":343,"icon":344},"Vite Nitro Plugin","\u002Fexamples\u002Fvite-nitro-plugin","4.examples\u002Fvite-nitro-plugin","i-logos-vitejs",{"title":346,"path":347,"stem":348,"icon":349},"Vite RSC","\u002Fexamples\u002Fvite-rsc","4.examples\u002Fvite-rsc","i-logos-react",{"title":351,"path":352,"stem":353,"icon":354},"Vite SSR HTML","\u002Fexamples\u002Fvite-ssr-html","4.examples\u002Fvite-ssr-html","i-logos-html-5",{"title":356,"path":357,"stem":358,"icon":359},"SSR with Preact","\u002Fexamples\u002Fvite-ssr-preact","4.examples\u002Fvite-ssr-preact","i-logos-preact",{"title":361,"path":362,"stem":363,"icon":349},"SSR with React","\u002Fexamples\u002Fvite-ssr-react","4.examples\u002Fvite-ssr-react",{"title":365,"path":366,"stem":367,"icon":368},"SSR with SolidJS","\u002Fexamples\u002Fvite-ssr-solid","4.examples\u002Fvite-ssr-solid","i-logos-solidjs-icon",{"title":370,"path":371,"stem":372,"icon":373},"SSR with TanStack Router","\u002Fexamples\u002Fvite-ssr-tsr-react","4.examples\u002Fvite-ssr-tsr-react","i-simple-icons-tanstack",{"title":375,"path":376,"stem":377,"icon":373},"SSR with TanStack Start","\u002Fexamples\u002Fvite-ssr-tss-react","4.examples\u002Fvite-ssr-tss-react",{"title":379,"path":380,"stem":381,"icon":382},"SSR with Vue Router","\u002Fexamples\u002Fvite-ssr-vue-router","4.examples\u002Fvite-ssr-vue-router","i-logos-vue",{"title":384,"path":385,"stem":386,"icon":387},"Vite + tRPC","\u002Fexamples\u002Fvite-trpc","4.examples\u002Fvite-trpc","i-simple-icons-trpc",{"title":63,"path":389,"stem":390,"icon":391},"\u002Fexamples\u002Fwebsocket","4.examples\u002Fwebsocket","i-lucide-radio",{"title":393,"path":394,"stem":395,"children":396},"Blog","\u002Fblog","9.blog",[397,400],{"title":393,"path":394,"stem":398,"icon":399},"9.blog\u002Findex","i-lucide-file-text",{"title":401,"path":402,"stem":403,"icon":399},"Nitro v3 Beta is here!","\u002Fblog\u002Fv3-beta","9.blog\u002F1.v3-beta",{"title":5,"path":405,"stem":406},"\u002F","index",{"id":408,"title":58,"body":409,"description":2038,"extension":2039,"meta":2040,"navigation":2041,"path":59,"seo":2042,"stem":60,"__hash__":2043},"content\u002F1.docs\u002F50.tasks.md",{"type":410,"value":411,"toc":2016,"icon":61},"minimark",[412,417,432,435,519,523,530,545,551,662,667,674,713,823,828,836,871,924,928,931,1023,1034,1038,1041,1121,1127,1139,1153,1157,1242,1247,1250,1262,1344,1348,1359,1363,1479,1483,1489,1503,1509,1513,1516,1520,1527,1530,1659,1665,1671,1918,1924,1928,1937,1941,1959,1963,1986,1992,1996,2000,2007,2012],[413,414,416],"h2",{"id":415},"opt-in-to-the-experimental-feature","Opt-in to the experimental feature",[418,419,420],"important",{},[421,422,423,424,431],"p",{},"\nTasks support is currently experimental.\nSee ",[425,426,430],"a",{"href":427,"rel":428},"https:\u002F\u002Fgithub.com\u002Fnitrojs\u002Fnitro\u002Fissues\u002F1974",[429],"nofollow","nitrojs\u002Fnitro#1974"," for the relevant discussion.",[421,433,434],{},"In order to use the tasks API you need to enable experimental feature flag.",[436,437,442],"pre",{"className":438,"code":439,"filename":440,"language":441,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  experimental: {\n    tasks: true\n  }\n})\n","nitro.config.ts","ts",[443,444,445,468,475,491,497,507,513],"code",{"__ignoreMap":5},[446,447,450,454,458,461,465],"span",{"class":448,"line":449},"line",1,[446,451,453],{"class":452},"so5gQ","import",[446,455,457],{"class":456},"slsVL"," { defineConfig } ",[446,459,460],{"class":452},"from",[446,462,464],{"class":463},"sfrk1"," \"nitro\"",[446,466,467],{"class":456},";\n",[446,469,471],{"class":448,"line":470},2,[446,472,474],{"emptyLinePlaceholder":473},true,"\n",[446,476,478,481,484,488],{"class":448,"line":477},3,[446,479,480],{"class":452},"export",[446,482,483],{"class":452}," default",[446,485,487],{"class":486},"shcOC"," defineConfig",[446,489,490],{"class":456},"({\n",[446,492,494],{"class":448,"line":493},4,[446,495,496],{"class":456},"  experimental: {\n",[446,498,500,503],{"class":448,"line":499},5,[446,501,502],{"class":456},"    tasks: ",[446,504,506],{"class":505},"suiK_","true\n",[446,508,510],{"class":448,"line":509},6,[446,511,512],{"class":456},"  }\n",[446,514,516],{"class":448,"line":515},7,[446,517,518],{"class":456},"})\n",[413,520,522],{"id":521},"define-tasks","Define tasks",[421,524,525,526,529],{},"Tasks can be defined in ",[443,527,528],{},"tasks\u002F[name].ts"," files.",[421,531,532,533,536,537,540,541,544],{},"Nested directories are supported. The task name will be joined with ",[443,534,535],{},":",". (Example: ",[443,538,539],{},"tasks\u002Fdb\u002Fmigrate.ts"," task name will be ",[443,542,543],{},"db:migrate",")",[421,546,547],{},[548,549,550],"strong",{},"Example:",[436,552,554],{"className":438,"code":553,"filename":539,"language":441,"meta":5,"style":5},"export default defineTask({\n  meta: {\n    name: \"db:migrate\",\n    description: \"Run database migrations\",\n  },\n  run({ payload, context }) {\n    console.log(\"Running DB migration task...\");\n    return { result: \"Success\" };\n  },\n});\n",[443,555,556,567,572,583,593,598,619,636,651,656],{"__ignoreMap":5},[446,557,558,560,562,565],{"class":448,"line":449},[446,559,480],{"class":452},[446,561,483],{"class":452},[446,563,564],{"class":486}," defineTask",[446,566,490],{"class":456},[446,568,569],{"class":448,"line":470},[446,570,571],{"class":456},"  meta: {\n",[446,573,574,577,580],{"class":448,"line":477},[446,575,576],{"class":456},"    name: ",[446,578,579],{"class":463},"\"db:migrate\"",[446,581,582],{"class":456},",\n",[446,584,585,588,591],{"class":448,"line":493},[446,586,587],{"class":456},"    description: ",[446,589,590],{"class":463},"\"Run database migrations\"",[446,592,582],{"class":456},[446,594,595],{"class":448,"line":499},[446,596,597],{"class":456},"  },\n",[446,599,600,603,606,610,613,616],{"class":448,"line":509},[446,601,602],{"class":486},"  run",[446,604,605],{"class":456},"({ ",[446,607,609],{"class":608},"sQHwn","payload",[446,611,612],{"class":456},", ",[446,614,615],{"class":608},"context",[446,617,618],{"class":456}," }) {\n",[446,620,621,624,627,630,633],{"class":448,"line":515},[446,622,623],{"class":456},"    console.",[446,625,626],{"class":486},"log",[446,628,629],{"class":456},"(",[446,631,632],{"class":463},"\"Running DB migration task...\"",[446,634,635],{"class":456},");\n",[446,637,639,642,645,648],{"class":448,"line":638},8,[446,640,641],{"class":452},"    return",[446,643,644],{"class":456}," { result: ",[446,646,647],{"class":463},"\"Success\"",[446,649,650],{"class":456}," };\n",[446,652,654],{"class":448,"line":653},9,[446,655,597],{"class":456},[446,657,659],{"class":448,"line":658},10,[446,660,661],{"class":456},"});\n",[663,664,666],"h3",{"id":665},"task-interface","Task interface",[421,668,669,670,673],{},"The ",[443,671,672],{},"defineTask"," helper accepts an object with the following properties:",[675,676,677,694],"ul",{},[678,679,680,685,686,689,690,693],"li",{},[548,681,682],{},[443,683,684],{},"meta"," (optional): An object with optional ",[443,687,688],{},"name"," and ",[443,691,692],{},"description"," string fields used for display in the dev server and CLI.",[678,695,696,701,702,708,709,712],{},[548,697,698],{},[443,699,700],{},"run"," (required): A function that receives a ",[425,703,705],{"href":704},"#taskevent",[443,706,707],{},"TaskEvent"," and returns (or resolves to) an object with an optional ",[443,710,711],{},"result"," property.",[436,714,716],{"className":438,"code":715,"language":441,"meta":5,"style":5},"interface Task\u003CRT = unknown> {\n  meta?: { name?: string; description?: string };\n  run(event: TaskEvent): { result?: RT } | Promise\u003C{ result?: RT }>;\n}\n",[443,717,718,741,770,818],{"__ignoreMap":5},[446,719,720,723,726,729,732,735,738],{"class":448,"line":449},[446,721,722],{"class":452},"interface",[446,724,725],{"class":486}," Task",[446,727,728],{"class":456},"\u003C",[446,730,731],{"class":486},"RT",[446,733,734],{"class":452}," =",[446,736,737],{"class":505}," unknown",[446,739,740],{"class":456},"> {\n",[446,742,743,746,749,752,754,756,759,762,764,766,768],{"class":448,"line":470},[446,744,745],{"class":608},"  meta",[446,747,748],{"class":452},"?:",[446,750,751],{"class":456}," { ",[446,753,688],{"class":608},[446,755,748],{"class":452},[446,757,758],{"class":505}," string",[446,760,761],{"class":456},"; ",[446,763,692],{"class":608},[446,765,748],{"class":452},[446,767,758],{"class":505},[446,769,650],{"class":456},[446,771,772,774,776,779,781,784,786,788,790,792,794,797,800,803,806,809,811,813,815],{"class":448,"line":477},[446,773,602],{"class":486},[446,775,629],{"class":456},[446,777,778],{"class":608},"event",[446,780,535],{"class":452},[446,782,783],{"class":486}," TaskEvent",[446,785,544],{"class":456},[446,787,535],{"class":452},[446,789,751],{"class":456},[446,791,711],{"class":608},[446,793,748],{"class":452},[446,795,796],{"class":486}," RT",[446,798,799],{"class":456}," } ",[446,801,802],{"class":452},"|",[446,804,805],{"class":486}," Promise",[446,807,808],{"class":456},"\u003C{ ",[446,810,711],{"class":608},[446,812,748],{"class":452},[446,814,796],{"class":486},[446,816,817],{"class":456}," }>;\n",[446,819,820],{"class":448,"line":493},[446,821,822],{"class":456},"}\n",[663,824,826],{"id":825},"taskevent",[443,827,707],{},[421,829,669,830,832,833,835],{},[443,831,700],{}," function receives a ",[443,834,707],{}," object with the following properties:",[675,837,838,845,856],{},[678,839,840,844],{},[548,841,842],{},[443,843,688],{},": The name of the task being executed.",[678,846,847,851,852,855],{},[548,848,849],{},[443,850,609],{},": An object (",[443,853,854],{},"Record\u003Cstring, unknown>",") containing any data passed to the task.",[678,857,858,862,863,866,867,870],{},[548,859,860],{},[443,861,615],{},": A ",[443,864,865],{},"TaskContext"," object (may include ",[443,868,869],{},"waitUntil"," depending on the runtime).",[436,872,874],{"className":438,"code":873,"language":441,"meta":5,"style":5},"interface TaskEvent {\n  name: string;\n  payload: TaskPayload;\n  context: TaskContext;\n}\n",[443,875,876,885,896,908,920],{"__ignoreMap":5},[446,877,878,880,882],{"class":448,"line":449},[446,879,722],{"class":452},[446,881,783],{"class":486},[446,883,884],{"class":456}," {\n",[446,886,887,890,892,894],{"class":448,"line":470},[446,888,889],{"class":608},"  name",[446,891,535],{"class":452},[446,893,758],{"class":505},[446,895,467],{"class":456},[446,897,898,901,903,906],{"class":448,"line":477},[446,899,900],{"class":608},"  payload",[446,902,535],{"class":452},[446,904,905],{"class":486}," TaskPayload",[446,907,467],{"class":456},[446,909,910,913,915,918],{"class":448,"line":493},[446,911,912],{"class":608},"  context",[446,914,535],{"class":452},[446,916,917],{"class":486}," TaskContext",[446,919,467],{"class":456},[446,921,922],{"class":448,"line":499},[446,923,822],{"class":456},[663,925,927],{"id":926},"registering-tasks-via-config","Registering tasks via config",[421,929,930],{},"In addition to file-based scanning, tasks can be registered directly in the Nitro config. This is useful for tasks provided by modules or pointing to custom handler paths.",[436,932,934],{"className":438,"code":933,"filename":440,"language":441,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  experimental: {\n    tasks: true\n  },\n  tasks: {\n    \"db:migrate\": {\n      handler: \".\u002Ftasks\u002Fcustom-migrate.ts\",\n      description: \"Run database migrations\"\n    }\n  }\n})\n",[443,935,936,948,952,962,966,972,976,981,989,999,1007,1013,1018],{"__ignoreMap":5},[446,937,938,940,942,944,946],{"class":448,"line":449},[446,939,453],{"class":452},[446,941,457],{"class":456},[446,943,460],{"class":452},[446,945,464],{"class":463},[446,947,467],{"class":456},[446,949,950],{"class":448,"line":470},[446,951,474],{"emptyLinePlaceholder":473},[446,953,954,956,958,960],{"class":448,"line":477},[446,955,480],{"class":452},[446,957,483],{"class":452},[446,959,487],{"class":486},[446,961,490],{"class":456},[446,963,964],{"class":448,"line":493},[446,965,496],{"class":456},[446,967,968,970],{"class":448,"line":499},[446,969,502],{"class":456},[446,971,506],{"class":505},[446,973,974],{"class":448,"line":509},[446,975,597],{"class":456},[446,977,978],{"class":448,"line":515},[446,979,980],{"class":456},"  tasks: {\n",[446,982,983,986],{"class":448,"line":638},[446,984,985],{"class":463},"    \"db:migrate\"",[446,987,988],{"class":456},": {\n",[446,990,991,994,997],{"class":448,"line":653},[446,992,993],{"class":456},"      handler: ",[446,995,996],{"class":463},"\".\u002Ftasks\u002Fcustom-migrate.ts\"",[446,998,582],{"class":456},[446,1000,1001,1004],{"class":448,"line":658},[446,1002,1003],{"class":456},"      description: ",[446,1005,1006],{"class":463},"\"Run database migrations\"\n",[446,1008,1010],{"class":448,"line":1009},11,[446,1011,1012],{"class":456},"    }\n",[446,1014,1016],{"class":448,"line":1015},12,[446,1017,512],{"class":456},[446,1019,1021],{"class":448,"line":1020},13,[446,1022,518],{"class":456},[421,1024,1025,1026,1029,1030,1033],{},"If a task is both scanned from the ",[443,1027,1028],{},"tasks\u002F"," directory and defined in the config, the config-defined ",[443,1031,1032],{},"handler"," takes precedence.",[413,1035,1037],{"id":1036},"scheduled-tasks","Scheduled tasks",[421,1039,1040],{},"You can define scheduled tasks using Nitro configuration to automatically run after each period of time.",[436,1042,1044],{"className":438,"code":1043,"filename":440,"language":441,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  scheduledTasks: {\n    \u002F\u002F Run `cms:update` task every minute\n    '* * * * *': ['cms:update'],\n    \u002F\u002F Run a single task (string shorthand)\n    '0 * * * *': 'db:cleanup'\n  }\n})\n",[443,1045,1046,1058,1062,1072,1077,1083,1097,1102,1113,1117],{"__ignoreMap":5},[446,1047,1048,1050,1052,1054,1056],{"class":448,"line":449},[446,1049,453],{"class":452},[446,1051,457],{"class":456},[446,1053,460],{"class":452},[446,1055,464],{"class":463},[446,1057,467],{"class":456},[446,1059,1060],{"class":448,"line":470},[446,1061,474],{"emptyLinePlaceholder":473},[446,1063,1064,1066,1068,1070],{"class":448,"line":477},[446,1065,480],{"class":452},[446,1067,483],{"class":452},[446,1069,487],{"class":486},[446,1071,490],{"class":456},[446,1073,1074],{"class":448,"line":493},[446,1075,1076],{"class":456},"  scheduledTasks: {\n",[446,1078,1079],{"class":448,"line":499},[446,1080,1082],{"class":1081},"sCsY4","    \u002F\u002F Run `cms:update` task every minute\n",[446,1084,1085,1088,1091,1094],{"class":448,"line":509},[446,1086,1087],{"class":463},"    '* * * * *'",[446,1089,1090],{"class":456},": [",[446,1092,1093],{"class":463},"'cms:update'",[446,1095,1096],{"class":456},"],\n",[446,1098,1099],{"class":448,"line":515},[446,1100,1101],{"class":1081},"    \u002F\u002F Run a single task (string shorthand)\n",[446,1103,1104,1107,1110],{"class":448,"line":638},[446,1105,1106],{"class":463},"    '0 * * * *'",[446,1108,1109],{"class":456},": ",[446,1111,1112],{"class":463},"'db:cleanup'\n",[446,1114,1115],{"class":448,"line":653},[446,1116,512],{"class":456},[446,1118,1119],{"class":448,"line":658},[446,1120,518],{"class":456},[421,1122,669,1123,1126],{},[443,1124,1125],{},"scheduledTasks"," config maps cron expressions to either a single task name (string) or an array of task names. When multiple tasks are assigned to the same cron expression, they run in parallel.",[1128,1129,1130],"tip",{},[421,1131,1132,1133,1138],{},"\nYou can use ",[425,1134,1137],{"href":1135,"rel":1136},"https:\u002F\u002Fcrontab.guru\u002F",[429],"crontab.guru"," to easily generate and understand cron tab patterns.",[421,1140,1141,1142,1144,1145,1148,1149,1152],{},"When a scheduled task runs, it automatically receives a ",[443,1143,609],{}," with ",[443,1146,1147],{},"scheduledTime"," set to the current timestamp (",[443,1150,1151],{},"Date.now()",").",[663,1154,1156],{"id":1155},"platform-support","Platform support",[675,1158,1159,1198,1217,1239],{},[678,1160,1161,612,1166,612,1171,612,1176,612,1181,689,1186,1191,1192,1197],{},[548,1162,1163],{},[443,1164,1165],{},"dev",[548,1167,1168],{},[443,1169,1170],{},"node_server",[548,1172,1173],{},[443,1174,1175],{},"node_cluster",[548,1177,1178],{},[443,1179,1180],{},"node_middleware",[548,1182,1183],{},[443,1184,1185],{},"bun",[548,1187,1188],{},[443,1189,1190],{},"deno_server"," presets are supported with the ",[425,1193,1196],{"href":1194,"rel":1195},"https:\u002F\u002Fcroner.56k.guru\u002F",[429],"croner"," engine.",[678,1199,1200,689,1205,1210,1211,1216],{},[548,1201,1202],{},[443,1203,1204],{},"cloudflare_module",[548,1206,1207],{},[443,1208,1209],{},"cloudflare_pages"," presets have native integration with ",[425,1212,1215],{"href":1213,"rel":1214},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fconfiguration\u002Fcron-triggers\u002F",[429],"Cron Triggers",". Nitro automatically generates the cron triggers in the wrangler config at build time - no manual wrangler setup required.",[678,1218,1219,1224,1225,1230,1231,1234,1235,1238],{},[548,1220,1221],{},[443,1222,1223],{},"vercel"," preset has native integration with ",[425,1226,1229],{"href":1227,"rel":1228},"https:\u002F\u002Fvercel.com\u002Fdocs\u002Fcron-jobs",[429],"Vercel Cron Jobs",". Nitro automatically generates the cron job configuration at build time - no manual ",[443,1232,1233],{},"vercel.json"," setup required. You can secure cron endpoints by setting the ",[443,1236,1237],{},"CRON_SECRET"," environment variable.",[678,1240,1241],{},"More presets (with native primitives support) are planned to be supported!",[413,1243,1245],{"id":1244},"waituntil",[443,1246,869],{},[421,1248,1249],{},"When running background tasks, you might want to make sure the server or worker waits until the task is done.",[421,1251,1252,1253,1256,1257,1261],{},"An optional ",[443,1254,1255],{},"context.waitUntil"," function ",[1258,1259,1260],"em",{},"might"," be available depending on the runtime.",[436,1263,1265],{"className":438,"code":1264,"language":441,"meta":5,"style":5},"export default defineTask({\n  run({ context }) {\n    const promise = fetch(...)\n    context.waitUntil?.(promise);\n    await promise;\n    return { result: \"Success\" };\n  },\n});\n",[443,1266,1267,1277,1287,1308,1318,1326,1336,1340],{"__ignoreMap":5},[446,1268,1269,1271,1273,1275],{"class":448,"line":449},[446,1270,480],{"class":452},[446,1272,483],{"class":452},[446,1274,564],{"class":486},[446,1276,490],{"class":456},[446,1278,1279,1281,1283,1285],{"class":448,"line":470},[446,1280,602],{"class":486},[446,1282,605],{"class":456},[446,1284,615],{"class":608},[446,1286,618],{"class":456},[446,1288,1289,1292,1295,1297,1300,1302,1305],{"class":448,"line":477},[446,1290,1291],{"class":452},"    const",[446,1293,1294],{"class":505}," promise",[446,1296,734],{"class":452},[446,1298,1299],{"class":486}," fetch",[446,1301,629],{"class":456},[446,1303,1304],{"class":452},"...",[446,1306,1307],{"class":456},")\n",[446,1309,1310,1313,1315],{"class":448,"line":493},[446,1311,1312],{"class":456},"    context.",[446,1314,869],{"class":486},[446,1316,1317],{"class":456},"?.(promise);\n",[446,1319,1320,1323],{"class":448,"line":499},[446,1321,1322],{"class":452},"    await",[446,1324,1325],{"class":456}," promise;\n",[446,1327,1328,1330,1332,1334],{"class":448,"line":509},[446,1329,641],{"class":452},[446,1331,644],{"class":456},[446,1333,647],{"class":463},[446,1335,650],{"class":456},[446,1337,1338],{"class":448,"line":515},[446,1339,597],{"class":456},[446,1341,1342],{"class":448,"line":638},[446,1343,661],{"class":456},[413,1345,1347],{"id":1346},"programmatically-run-tasks","Programmatically run tasks",[421,1349,1350,1351,1354,1355,1358],{},"To manually run tasks, you can use ",[443,1352,1353],{},"runTask(name, { payload?, context? })"," utility from ",[443,1356,1357],{},"nitro\u002Ftask",".",[421,1360,1361],{},[548,1362,550],{},[436,1364,1367],{"className":438,"code":1365,"filename":1366,"language":441,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler(async (event) => {\n  \u002F\u002F IMPORTANT: Authenticate user and validate payload!\n  const payload = Object.fromEntries(event.url.searchParams);\n  const { result } = await runTask(\"db:migrate\", { payload });\n\n  return { result };\n});\n","api\u002Fmigrate.ts",[443,1368,1369,1382,1386,1413,1418,1437,1463,1467,1475],{"__ignoreMap":5},[446,1370,1371,1373,1376,1378,1380],{"class":448,"line":449},[446,1372,453],{"class":452},[446,1374,1375],{"class":456}," { defineHandler } ",[446,1377,460],{"class":452},[446,1379,464],{"class":463},[446,1381,467],{"class":456},[446,1383,1384],{"class":448,"line":470},[446,1385,474],{"emptyLinePlaceholder":473},[446,1387,1388,1390,1392,1395,1397,1400,1403,1405,1408,1411],{"class":448,"line":477},[446,1389,480],{"class":452},[446,1391,483],{"class":452},[446,1393,1394],{"class":486}," defineHandler",[446,1396,629],{"class":456},[446,1398,1399],{"class":452},"async",[446,1401,1402],{"class":456}," (",[446,1404,778],{"class":608},[446,1406,1407],{"class":456},") ",[446,1409,1410],{"class":452},"=>",[446,1412,884],{"class":456},[446,1414,1415],{"class":448,"line":493},[446,1416,1417],{"class":1081},"  \u002F\u002F IMPORTANT: Authenticate user and validate payload!\n",[446,1419,1420,1423,1426,1428,1431,1434],{"class":448,"line":499},[446,1421,1422],{"class":452},"  const",[446,1424,1425],{"class":505}," payload",[446,1427,734],{"class":452},[446,1429,1430],{"class":456}," Object.",[446,1432,1433],{"class":486},"fromEntries",[446,1435,1436],{"class":456},"(event.url.searchParams);\n",[446,1438,1439,1441,1443,1445,1447,1450,1453,1456,1458,1460],{"class":448,"line":509},[446,1440,1422],{"class":452},[446,1442,751],{"class":456},[446,1444,711],{"class":505},[446,1446,799],{"class":456},[446,1448,1449],{"class":452},"=",[446,1451,1452],{"class":452}," await",[446,1454,1455],{"class":486}," runTask",[446,1457,629],{"class":456},[446,1459,579],{"class":463},[446,1461,1462],{"class":456},", { payload });\n",[446,1464,1465],{"class":448,"line":515},[446,1466,474],{"emptyLinePlaceholder":473},[446,1468,1469,1472],{"class":448,"line":638},[446,1470,1471],{"class":452},"  return",[446,1473,1474],{"class":456}," { result };\n",[446,1476,1477],{"class":448,"line":653},[446,1478,661],{"class":456},[663,1480,1482],{"id":1481},"error-handling","Error handling",[421,1484,1485,1488],{},[443,1486,1487],{},"runTask"," throws an HTTP error if:",[675,1490,1491,1497],{},[678,1492,1493,1494,1152],{},"The task does not exist (status ",[443,1495,1496],{},"404",[678,1498,1499,1500,1152],{},"The task has no handler implementation (status ",[443,1501,1502],{},"501",[421,1504,1505,1506,1508],{},"Any errors thrown inside the task's ",[443,1507,700],{}," function will propagate to the caller.",[413,1510,1512],{"id":1511},"run-tasks-with-dev-server","Run tasks with dev server",[421,1514,1515],{},"Nitro's built-in dev server exposes tasks to be easily executed without programmatic usage.",[663,1517,1519],{"id":1518},"using-api-routes","Using API routes",[1521,1522,1524],"h4",{"id":1523},"_nitrotasks",[443,1525,1526],{},"\u002F_nitro\u002Ftasks",[421,1528,1529],{},"This endpoint returns a list of available task names and their meta.",[436,1531,1535],{"className":1532,"code":1533,"language":1534,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","\u002F\u002F [GET] \u002F_nitro\u002Ftasks\n{\n  \"tasks\": {\n    \"db:migrate\": {\n      \"description\": \"Run database migrations\"\n    },\n     \"cms:update\": {\n      \"description\": \"Update CMS content\"\n    }\n  },\n  \"scheduledTasks\": [\n    {\n      \"cron\": \"* * * * *\",\n      \"tasks\": [\n        \"cms:update\"\n      ]\n    }\n  ]\n}\n","json",[443,1536,1537,1542,1547,1554,1560,1569,1574,1581,1590,1594,1598,1606,1611,1623,1631,1637,1643,1648,1654],{"__ignoreMap":5},[446,1538,1539],{"class":448,"line":449},[446,1540,1541],{"class":1081},"\u002F\u002F [GET] \u002F_nitro\u002Ftasks\n",[446,1543,1544],{"class":448,"line":470},[446,1545,1546],{"class":456},"{\n",[446,1548,1549,1552],{"class":448,"line":477},[446,1550,1551],{"class":505},"  \"tasks\"",[446,1553,988],{"class":456},[446,1555,1556,1558],{"class":448,"line":493},[446,1557,985],{"class":505},[446,1559,988],{"class":456},[446,1561,1562,1565,1567],{"class":448,"line":499},[446,1563,1564],{"class":505},"      \"description\"",[446,1566,1109],{"class":456},[446,1568,1006],{"class":463},[446,1570,1571],{"class":448,"line":509},[446,1572,1573],{"class":456},"    },\n",[446,1575,1576,1579],{"class":448,"line":515},[446,1577,1578],{"class":505},"     \"cms:update\"",[446,1580,988],{"class":456},[446,1582,1583,1585,1587],{"class":448,"line":638},[446,1584,1564],{"class":505},[446,1586,1109],{"class":456},[446,1588,1589],{"class":463},"\"Update CMS content\"\n",[446,1591,1592],{"class":448,"line":653},[446,1593,1012],{"class":456},[446,1595,1596],{"class":448,"line":658},[446,1597,597],{"class":456},[446,1599,1600,1603],{"class":448,"line":1009},[446,1601,1602],{"class":505},"  \"scheduledTasks\"",[446,1604,1605],{"class":456},": [\n",[446,1607,1608],{"class":448,"line":1015},[446,1609,1610],{"class":456},"    {\n",[446,1612,1613,1616,1618,1621],{"class":448,"line":1020},[446,1614,1615],{"class":505},"      \"cron\"",[446,1617,1109],{"class":456},[446,1619,1620],{"class":463},"\"* * * * *\"",[446,1622,582],{"class":456},[446,1624,1626,1629],{"class":448,"line":1625},14,[446,1627,1628],{"class":505},"      \"tasks\"",[446,1630,1605],{"class":456},[446,1632,1634],{"class":448,"line":1633},15,[446,1635,1636],{"class":463},"        \"cms:update\"\n",[446,1638,1640],{"class":448,"line":1639},16,[446,1641,1642],{"class":456},"      ]\n",[446,1644,1646],{"class":448,"line":1645},17,[446,1647,1012],{"class":456},[446,1649,1651],{"class":448,"line":1650},18,[446,1652,1653],{"class":456},"  ]\n",[446,1655,1657],{"class":448,"line":1656},19,[446,1658,822],{"class":456},[1521,1660,1662],{"id":1661},"_nitrotasksname",[443,1663,1664],{},"\u002F_nitro\u002Ftasks\u002F:name",[421,1666,1667,1668,712],{},"This endpoint executes a task. You can provide a payload using both query parameters and body JSON payload. The payload sent in the JSON body payload must be under the ",[443,1669,1670],{},"\"payload\"",[1672,1673,1674,1758,1807],"code-group",{},[436,1675,1678],{"className":438,"code":1676,"filename":1677,"language":441,"meta":5,"style":5},"export default defineTask({\n  meta: {\n    name: \"echo:payload\",\n    description: \"Returns the provided payload\",\n  },\n  run({ payload, context }) {\n    console.log(\"Running echo task...\");\n    return { result: payload };\n  },\n});\n","tasks\u002Fecho\u002Fpayload.ts",[443,1679,1680,1690,1694,1703,1712,1716,1730,1743,1750,1754],{"__ignoreMap":5},[446,1681,1682,1684,1686,1688],{"class":448,"line":449},[446,1683,480],{"class":452},[446,1685,483],{"class":452},[446,1687,564],{"class":486},[446,1689,490],{"class":456},[446,1691,1692],{"class":448,"line":470},[446,1693,571],{"class":456},[446,1695,1696,1698,1701],{"class":448,"line":477},[446,1697,576],{"class":456},[446,1699,1700],{"class":463},"\"echo:payload\"",[446,1702,582],{"class":456},[446,1704,1705,1707,1710],{"class":448,"line":493},[446,1706,587],{"class":456},[446,1708,1709],{"class":463},"\"Returns the provided payload\"",[446,1711,582],{"class":456},[446,1713,1714],{"class":448,"line":499},[446,1715,597],{"class":456},[446,1717,1718,1720,1722,1724,1726,1728],{"class":448,"line":509},[446,1719,602],{"class":486},[446,1721,605],{"class":456},[446,1723,609],{"class":608},[446,1725,612],{"class":456},[446,1727,615],{"class":608},[446,1729,618],{"class":456},[446,1731,1732,1734,1736,1738,1741],{"class":448,"line":515},[446,1733,623],{"class":456},[446,1735,626],{"class":486},[446,1737,629],{"class":456},[446,1739,1740],{"class":463},"\"Running echo task...\"",[446,1742,635],{"class":456},[446,1744,1745,1747],{"class":448,"line":638},[446,1746,641],{"class":452},[446,1748,1749],{"class":456}," { result: payload };\n",[446,1751,1752],{"class":448,"line":653},[446,1753,597],{"class":456},[446,1755,1756],{"class":448,"line":658},[446,1757,661],{"class":456},[436,1759,1762],{"className":1532,"code":1760,"filename":1761,"language":1534,"meta":5,"style":5},"\u002F\u002F [GET] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value&array=1&array=2\n{\n  \"field\": \"value\",\n  \"array\": [\"1\", \"2\"]\n}\n","GET",[443,1763,1764,1769,1773,1785,1803],{"__ignoreMap":5},[446,1765,1766],{"class":448,"line":449},[446,1767,1768],{"class":1081},"\u002F\u002F [GET] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value&array=1&array=2\n",[446,1770,1771],{"class":448,"line":470},[446,1772,1546],{"class":456},[446,1774,1775,1778,1780,1783],{"class":448,"line":477},[446,1776,1777],{"class":505},"  \"field\"",[446,1779,1109],{"class":456},[446,1781,1782],{"class":463},"\"value\"",[446,1784,582],{"class":456},[446,1786,1787,1790,1792,1795,1797,1800],{"class":448,"line":493},[446,1788,1789],{"class":505},"  \"array\"",[446,1791,1090],{"class":456},[446,1793,1794],{"class":463},"\"1\"",[446,1796,612],{"class":456},[446,1798,1799],{"class":463},"\"2\"",[446,1801,1802],{"class":456},"]\n",[446,1804,1805],{"class":448,"line":499},[446,1806,822],{"class":456},[436,1808,1811],{"className":1532,"code":1809,"filename":1810,"language":1534,"meta":5,"style":5},"\u002F**\n * [POST] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value\n * body: {\n *   \"payload\": {\n *     \"answer\": 42,\n *     \"nested\": {\n *       \"value\": true\n *     }\n *   }\n * }\n *\u002F\n{\n  \"field\": \"value\",\n  \"answer\": 42,\n  \"nested\": {\n    \"value\": true\n  }\n}\n","POST",[443,1812,1813,1818,1823,1828,1833,1838,1843,1848,1853,1858,1863,1868,1872,1882,1894,1901,1910,1914],{"__ignoreMap":5},[446,1814,1815],{"class":448,"line":449},[446,1816,1817],{"class":1081},"\u002F**\n",[446,1819,1820],{"class":448,"line":470},[446,1821,1822],{"class":1081}," * [POST] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value\n",[446,1824,1825],{"class":448,"line":477},[446,1826,1827],{"class":1081}," * body: {\n",[446,1829,1830],{"class":448,"line":493},[446,1831,1832],{"class":1081}," *   \"payload\": {\n",[446,1834,1835],{"class":448,"line":499},[446,1836,1837],{"class":1081}," *     \"answer\": 42,\n",[446,1839,1840],{"class":448,"line":509},[446,1841,1842],{"class":1081}," *     \"nested\": {\n",[446,1844,1845],{"class":448,"line":515},[446,1846,1847],{"class":1081}," *       \"value\": true\n",[446,1849,1850],{"class":448,"line":638},[446,1851,1852],{"class":1081}," *     }\n",[446,1854,1855],{"class":448,"line":653},[446,1856,1857],{"class":1081}," *   }\n",[446,1859,1860],{"class":448,"line":658},[446,1861,1862],{"class":1081}," * }\n",[446,1864,1865],{"class":448,"line":1009},[446,1866,1867],{"class":1081}," *\u002F\n",[446,1869,1870],{"class":448,"line":1015},[446,1871,1546],{"class":456},[446,1873,1874,1876,1878,1880],{"class":448,"line":1020},[446,1875,1777],{"class":505},[446,1877,1109],{"class":456},[446,1879,1782],{"class":463},[446,1881,582],{"class":456},[446,1883,1884,1887,1889,1892],{"class":448,"line":1625},[446,1885,1886],{"class":505},"  \"answer\"",[446,1888,1109],{"class":456},[446,1890,1891],{"class":505},"42",[446,1893,582],{"class":456},[446,1895,1896,1899],{"class":448,"line":1633},[446,1897,1898],{"class":505},"  \"nested\"",[446,1900,988],{"class":456},[446,1902,1903,1906,1908],{"class":448,"line":1639},[446,1904,1905],{"class":505},"    \"value\"",[446,1907,1109],{"class":456},[446,1909,506],{"class":505},[446,1911,1912],{"class":448,"line":1645},[446,1913,512],{"class":456},[446,1915,1916],{"class":448,"line":1650},[446,1917,822],{"class":456},[1919,1920,1921],"note",{},[421,1922,1923],{},"\nThe JSON payload included in the body will overwrite the keys present in the query params.",[663,1925,1927],{"id":1926},"using-cli","Using CLI",[418,1929,1930],{},[421,1931,1932,1933,1936],{},"\nIt is only possible to run these commands while the ",[548,1934,1935],{},"dev server is running",". You should run them in a second terminal.",[1521,1938,1940],{"id":1939},"list-tasks","List tasks",[436,1942,1946],{"className":1943,"code":1944,"language":1945,"meta":5,"style":5},"language-sh shiki shiki-themes github-light github-dark github-dark","nitro task list\n","sh",[443,1947,1948],{"__ignoreMap":5},[446,1949,1950,1953,1956],{"class":448,"line":449},[446,1951,1952],{"class":486},"nitro",[446,1954,1955],{"class":463}," task",[446,1957,1958],{"class":463}," list\n",[1521,1960,1962],{"id":1961},"run-a-task","Run a task",[436,1964,1966],{"className":1943,"code":1965,"language":1945,"meta":5,"style":5},"nitro task run db:migrate --payload \"{}\"\n",[443,1967,1968],{"__ignoreMap":5},[446,1969,1970,1972,1974,1977,1980,1983],{"class":448,"line":449},[446,1971,1952],{"class":486},[446,1973,1955],{"class":463},[446,1975,1976],{"class":463}," run",[446,1978,1979],{"class":463}," db:migrate",[446,1981,1982],{"class":505}," --payload",[446,1984,1985],{"class":463}," \"{}\"\n",[421,1987,669,1988,1991],{},[443,1989,1990],{},"--payload"," flag accepts a JSON string that will be parsed and passed to the task. If the value is not a valid JSON object, the task runs without a payload.",[413,1993,1995],{"id":1994},"notes","Notes",[663,1997,1999],{"id":1998},"concurrency","Concurrency",[421,2001,2002,2003,2006],{},"Each task can have ",[548,2004,2005],{},"one running instance",". Calling a task of same name multiple times in parallel, results in calling it once and all callers will get the same return value.",[1919,2008,2009],{},[421,2010,2011],{},"\nNitro tasks can be running multiple times and in parallel.",[2013,2014,2015],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}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 .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":5,"searchDepth":470,"depth":470,"links":2017},[2018,2019,2024,2027,2028,2031,2035],{"id":415,"depth":470,"text":416},{"id":521,"depth":470,"text":522,"children":2020},[2021,2022,2023],{"id":665,"depth":477,"text":666},{"id":825,"depth":477,"text":707},{"id":926,"depth":477,"text":927},{"id":1036,"depth":470,"text":1037,"children":2025},[2026],{"id":1155,"depth":477,"text":1156},{"id":1244,"depth":470,"text":869},{"id":1346,"depth":470,"text":1347,"children":2029},[2030],{"id":1481,"depth":477,"text":1482},{"id":1511,"depth":470,"text":1512,"children":2032},[2033,2034],{"id":1518,"depth":477,"text":1519},{"id":1926,"depth":477,"text":1927},{"id":1994,"depth":470,"text":1995,"children":2036},[2037],{"id":1998,"depth":477,"text":1999},"Nitro tasks allow on-off operations in runtime.","md",{"icon":61},{"icon":61},{"title":58,"description":2038},"3jQ3dnDLUDKaMT1X1oE0c6YFmJxcm80KqW4e_xxwe80",[2045,2047],{"title":53,"path":54,"stem":55,"description":2046,"icon":56,"children":-1},"Use plugins to extend Nitro's runtime behavior.",{"title":63,"path":64,"stem":65,"description":2048,"icon":66,"children":-1},"Nitro provides cross-platform WebSocket support powered by CrossWS and H3.",1784540450235]