[{"data":1,"prerenderedAt":2170},["ShallowReactive",2],{"navigation":3,"-docs-storage":393,"-docs-storage-surround":2166},[4,88,217,223,378,390],{"title":5,"path":6,"stem":7,"children":8,"icon":87},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"WebSocket","/docs/websocket","1.docs/50.websocket","ri:broadcast-fill",{"title":63,"path":64,"stem":65,"icon":66},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":68,"path":69,"stem":70,"icon":71},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":73,"path":74,"stem":75,"icon":76},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":78,"path":79,"stem":80,"icon":81},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":83,"path":84,"stem":85,"icon":86},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":89,"path":90,"stem":91,"children":92,"icon":94},"Deploy","/deploy","2.deploy/0.index",[93,95,116],{"title":89,"path":90,"stem":91,"icon":94},"ri:upload-cloud-2-line",{"title":96,"path":97,"stem":98,"children":99,"page":115},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[100,105,110],{"title":101,"path":102,"stem":103,"icon":104},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":106,"path":107,"stem":108,"icon":109},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":111,"path":112,"stem":113,"icon":114},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":117,"path":118,"stem":119,"children":120,"page":115},"Providers","/deploy/providers","2.deploy/20.providers",[121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197,201,205,209,213],{"title":122,"path":123,"stem":124},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":126,"path":127,"stem":128},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":130,"path":131,"stem":132},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":134,"path":135,"stem":136},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":138,"path":139,"stem":140},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":142,"path":143,"stem":144},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":146,"path":147,"stem":148},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":150,"path":151,"stem":152},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":154,"path":155,"stem":156},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":158,"path":159,"stem":160},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":162,"path":163,"stem":164},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":166,"path":167,"stem":168},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":170,"path":171,"stem":172},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":174,"path":175,"stem":176},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":178,"path":179,"stem":180},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":182,"path":183,"stem":184},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":186,"path":187,"stem":188},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":190,"path":191,"stem":192},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":194,"path":195,"stem":196},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":198,"path":199,"stem":200},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":202,"path":203,"stem":204},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":206,"path":207,"stem":208},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":210,"path":211,"stem":212},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":214,"path":215,"stem":216},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":218,"path":219,"stem":220,"children":221,"icon":36},"Config","/config","3.config/0.index",[222],{"title":218,"path":219,"stem":220,"icon":36},{"title":224,"path":225,"stem":226,"children":227,"icon":229},"Examples","/examples","4.examples/0.index",[228,230,235,240,245,250,254,259,264,269,274,279,284,288,293,297,301,306,311,316,321,326,331,336,341,346,350,355,360,364,369,374],{"title":224,"path":225,"stem":226,"icon":229},"i-lucide-folder-code",{"title":231,"path":232,"stem":233,"icon":234},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":236,"path":237,"stem":238,"icon":239},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":241,"path":242,"stem":243,"icon":244},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":246,"path":247,"stem":248,"icon":249},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":251,"stem":252,"icon":253},"/examples/database","4.examples/database","i-lucide-database",{"title":255,"path":256,"stem":257,"icon":258},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":260,"path":261,"stem":262,"icon":263},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":270,"path":271,"stem":272,"icon":273},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":275,"path":276,"stem":277,"icon":278},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":280,"path":281,"stem":282,"icon":283},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":285,"path":286,"stem":287,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":289,"path":290,"stem":291,"icon":292},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":294,"path":295,"stem":296,"icon":292},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":48,"path":298,"stem":299,"icon":300},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":302,"path":303,"stem":304,"icon":305},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":307,"path":308,"stem":309,"icon":310},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":312,"path":313,"stem":314,"icon":315},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":317,"path":318,"stem":319,"icon":320},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":322,"path":323,"stem":324,"icon":325},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":327,"path":328,"stem":329,"icon":330},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":332,"path":333,"stem":334,"icon":335},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":337,"path":338,"stem":339,"icon":340},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":342,"path":343,"stem":344,"icon":345},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":347,"path":348,"stem":349,"icon":335},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":351,"path":352,"stem":353,"icon":354},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":356,"path":357,"stem":358,"icon":359},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":361,"path":362,"stem":363,"icon":359},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":365,"path":366,"stem":367,"icon":368},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":370,"path":371,"stem":372,"icon":373},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":58,"path":375,"stem":376,"icon":377},"/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":379,"path":380,"stem":381,"children":382},"Blog","/blog","9.blog",[383,386],{"title":379,"path":380,"stem":384,"icon":385},"9.blog/index","i-lucide-file-text",{"title":387,"path":388,"stem":389,"icon":385},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":391,"stem":392},"/","index",{"id":394,"title":73,"body":395,"description":2160,"extension":2161,"meta":2162,"navigation":2163,"path":74,"seo":2164,"stem":75,"__hash__":2165},"content/1.docs/8.storage.md",{"type":396,"value":397,"toc":2143,"icon":76},"minimark",[398,410,415,423,675,678,683,689,912,933,1118,1121,1128,1131,1210,1217,1228,1232,1239,1242,1347,1356,1360,1363,1369,1379,1433,1437,1440,1488,1501,1504,1515,1523,1668,1672,1679,1753,1759,1837,1841,1844,1940,1946,1950,1956,2128,2139],[399,400,401,402,409],"p",{},"Nitro has built-in integration with ",[403,404,408],"a",{"href":405,"rel":406},"https://unstorage.unjs.io",[407],"nofollow","unstorage"," to provide a runtime agnostic persistent layer.",[411,412,414],"h2",{"id":413},"usage","Usage",[399,416,417,418,422],{},"To use the storage layer, you can use the ",[419,420,421],"code",{},"useStorage()"," utility to access the storage instance.",[424,425,429],"pre",{"className":426,"code":427,"language":428,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { useStorage } from \"nitro/storage\";\n\n// Default storage (in-memory)\nawait useStorage().setItem(\"test:foo\", { hello: \"world\" });\nconst value = await useStorage().getItem(\"test:foo\");\n\n// You can specify a base prefix with useStorage(base)\nconst testStorage = useStorage(\"test\");\nawait testStorage.setItem(\"foo\", { hello: \"world\" });\nawait testStorage.getItem(\"foo\"); // { hello: \"world\" }\n\n// You can use generics to type the return value\nawait useStorage\u003C{ hello: string }>(\"test\").getItem(\"foo\");\nawait useStorage(\"test\").getItem\u003C{ hello: string }>(\"foo\");\n","ts",[419,430,431,454,461,468,499,529,534,540,559,580,599,604,610,646],{"__ignoreMap":5},[432,433,436,440,444,447,451],"span",{"class":434,"line":435},"line",1,[432,437,439],{"class":438},"so5gQ","import",[432,441,443],{"class":442},"slsVL"," { useStorage } ",[432,445,446],{"class":438},"from",[432,448,450],{"class":449},"sfrk1"," \"nitro/storage\"",[432,452,453],{"class":442},";\n",[432,455,457],{"class":434,"line":456},2,[432,458,460],{"emptyLinePlaceholder":459},true,"\n",[432,462,464],{"class":434,"line":463},3,[432,465,467],{"class":466},"sCsY4","// Default storage (in-memory)\n",[432,469,471,474,478,481,484,487,490,493,496],{"class":434,"line":470},4,[432,472,473],{"class":438},"await",[432,475,477],{"class":476},"shcOC"," useStorage",[432,479,480],{"class":442},"().",[432,482,483],{"class":476},"setItem",[432,485,486],{"class":442},"(",[432,488,489],{"class":449},"\"test:foo\"",[432,491,492],{"class":442},", { hello: ",[432,494,495],{"class":449},"\"world\"",[432,497,498],{"class":442}," });\n",[432,500,502,505,509,512,515,517,519,522,524,526],{"class":434,"line":501},5,[432,503,504],{"class":438},"const",[432,506,508],{"class":507},"suiK_"," value",[432,510,511],{"class":438}," =",[432,513,514],{"class":438}," await",[432,516,477],{"class":476},[432,518,480],{"class":442},[432,520,521],{"class":476},"getItem",[432,523,486],{"class":442},[432,525,489],{"class":449},[432,527,528],{"class":442},");\n",[432,530,532],{"class":434,"line":531},6,[432,533,460],{"emptyLinePlaceholder":459},[432,535,537],{"class":434,"line":536},7,[432,538,539],{"class":466},"// You can specify a base prefix with useStorage(base)\n",[432,541,543,545,548,550,552,554,557],{"class":434,"line":542},8,[432,544,504],{"class":438},[432,546,547],{"class":507}," testStorage",[432,549,511],{"class":438},[432,551,477],{"class":476},[432,553,486],{"class":442},[432,555,556],{"class":449},"\"test\"",[432,558,528],{"class":442},[432,560,562,564,567,569,571,574,576,578],{"class":434,"line":561},9,[432,563,473],{"class":438},[432,565,566],{"class":442}," testStorage.",[432,568,483],{"class":476},[432,570,486],{"class":442},[432,572,573],{"class":449},"\"foo\"",[432,575,492],{"class":442},[432,577,495],{"class":449},[432,579,498],{"class":442},[432,581,583,585,587,589,591,593,596],{"class":434,"line":582},10,[432,584,473],{"class":438},[432,586,566],{"class":442},[432,588,521],{"class":476},[432,590,486],{"class":442},[432,592,573],{"class":449},[432,594,595],{"class":442},"); ",[432,597,598],{"class":466},"// { hello: \"world\" }\n",[432,600,602],{"class":434,"line":601},11,[432,603,460],{"emptyLinePlaceholder":459},[432,605,607],{"class":434,"line":606},12,[432,608,609],{"class":466},"// You can use generics to type the return value\n",[432,611,613,615,617,620,624,627,630,633,635,638,640,642,644],{"class":434,"line":612},13,[432,614,473],{"class":438},[432,616,477],{"class":476},[432,618,619],{"class":442},"\u003C{ ",[432,621,623],{"class":622},"sQHwn","hello",[432,625,626],{"class":438},":",[432,628,629],{"class":507}," string",[432,631,632],{"class":442}," }>(",[432,634,556],{"class":449},[432,636,637],{"class":442},").",[432,639,521],{"class":476},[432,641,486],{"class":442},[432,643,573],{"class":449},[432,645,528],{"class":442},[432,647,649,651,653,655,657,659,661,663,665,667,669,671,673],{"class":434,"line":648},14,[432,650,473],{"class":438},[432,652,477],{"class":476},[432,654,486],{"class":442},[432,656,556],{"class":449},[432,658,637],{"class":442},[432,660,521],{"class":476},[432,662,619],{"class":442},[432,664,623],{"class":622},[432,666,626],{"class":438},[432,668,629],{"class":507},[432,670,632],{"class":442},[432,672,573],{"class":449},[432,674,528],{"class":442},[676,677],"read-more",{"to":405},[679,680,682],"h3",{"id":681},"available-methods","Available methods",[399,684,685,686,688],{},"The storage instance returned by ",[419,687,421],{}," provides the following methods:",[690,691,692,705],"table",{},[693,694,695],"thead",{},[696,697,698,702],"tr",{},[699,700,701],"th",{},"Method",[699,703,704],{},"Description",[706,707,708,723,737,747,757,770,780,790,800,810,820,840,850,860,870,880,902],"tbody",{},[696,709,710,716],{},[711,712,713],"td",{},[419,714,715],{},"getItem(key)",[711,717,718,719,722],{},"Get the value of a key. Returns ",[419,720,721],{},"null"," if the key does not exist.",[696,724,725,730],{},[711,726,727],{},[419,728,729],{},"getItems(items)",[711,731,732,733,736],{},"Get multiple items at once. Accepts an array of keys or ",[419,734,735],{},"{ key, options }"," objects.",[696,738,739,744],{},[711,740,741],{},[419,742,743],{},"getItemRaw(key)",[711,745,746],{},"Get the raw value of a key without parsing. Useful for binary data.",[696,748,749,754],{},[711,750,751],{},[419,752,753],{},"setItem(key, value)",[711,755,756],{},"Set the value of a key.",[696,758,759,764],{},[711,760,761],{},[419,762,763],{},"setItems(items)",[711,765,766,767,736],{},"Set multiple items at once. Accepts an array of ",[419,768,769],{},"{ key, value }",[696,771,772,777],{},[711,773,774],{},[419,775,776],{},"setItemRaw(key, value)",[711,778,779],{},"Set the raw value of a key without serialization.",[696,781,782,787],{},[711,783,784],{},[419,785,786],{},"hasItem(key)",[711,788,789],{},"Check if a key exists. Returns a boolean.",[696,791,792,797],{},[711,793,794],{},[419,795,796],{},"removeItem(key)",[711,798,799],{},"Remove a key from storage.",[696,801,802,807],{},[711,803,804],{},[419,805,806],{},"getKeys(base?)",[711,808,809],{},"Get all keys, optionally filtered by a base prefix.",[696,811,812,817],{},[711,813,814],{},[419,815,816],{},"clear(base?)",[711,818,819],{},"Clear all keys, optionally filtered by a base prefix.",[696,821,822,827],{},[711,823,824],{},[419,825,826],{},"getMeta(key)",[711,828,829,830,833,834,833,837,637],{},"Get metadata for a key (e.g., ",[419,831,832],{},"mtime",", ",[419,835,836],{},"atime",[419,838,839],{},"ttl",[696,841,842,847],{},[711,843,844],{},[419,845,846],{},"setMeta(key, meta)",[711,848,849],{},"Set metadata for a key.",[696,851,852,857],{},[711,853,854],{},[419,855,856],{},"removeMeta(key)",[711,858,859],{},"Remove metadata for a key.",[696,861,862,867],{},[711,863,864],{},[419,865,866],{},"mount(base, driver)",[711,868,869],{},"Dynamically mount a storage driver at a base path.",[696,871,872,877],{},[711,873,874],{},[419,875,876],{},"unmount(base)",[711,878,879],{},"Unmount a storage driver from a base path.",[696,881,882,887],{},[711,883,884],{},[419,885,886],{},"watch(callback)",[711,888,889,890,893,894,897,898,901],{},"Watch for changes. Callback receives ",[419,891,892],{},"(event, key)"," where event is ",[419,895,896],{},"\"update\""," or ",[419,899,900],{},"\"remove\"",".",[696,903,904,909],{},[711,905,906],{},[419,907,908],{},"unwatch()",[711,910,911],{},"Stop watching for changes.",[399,913,914,915,833,918,833,921,833,924,833,927,833,930,901],{},"Shorthand aliases are also available: ",[419,916,917],{},"get",[419,919,920],{},"set",[419,922,923],{},"has",[419,925,926],{},"del",[419,928,929],{},"remove",[419,931,932],{},"keys",[424,934,936],{"className":426,"code":935,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\n\n// Get all keys under a prefix\nconst keys = await useStorage(\"test\").getKeys();\n\n// Check if a key exists\nconst exists = await useStorage().hasItem(\"test:foo\");\n\n// Remove a key\nawait useStorage().removeItem(\"test:foo\");\n\n// Get raw binary data\nconst raw = await useStorage().getItemRaw(\"assets/server:image.png\");\n\n// Get metadata (type, etag, mtime, etc.)\nconst meta = await useStorage(\"assets/server\").getMeta(\"file.txt\");\n",[419,937,938,950,954,959,984,988,993,1017,1021,1026,1043,1047,1052,1077,1081,1087],{"__ignoreMap":5},[432,939,940,942,944,946,948],{"class":434,"line":435},[432,941,439],{"class":438},[432,943,443],{"class":442},[432,945,446],{"class":438},[432,947,450],{"class":449},[432,949,453],{"class":442},[432,951,952],{"class":434,"line":456},[432,953,460],{"emptyLinePlaceholder":459},[432,955,956],{"class":434,"line":463},[432,957,958],{"class":466},"// Get all keys under a prefix\n",[432,960,961,963,966,968,970,972,974,976,978,981],{"class":434,"line":470},[432,962,504],{"class":438},[432,964,965],{"class":507}," keys",[432,967,511],{"class":438},[432,969,514],{"class":438},[432,971,477],{"class":476},[432,973,486],{"class":442},[432,975,556],{"class":449},[432,977,637],{"class":442},[432,979,980],{"class":476},"getKeys",[432,982,983],{"class":442},"();\n",[432,985,986],{"class":434,"line":501},[432,987,460],{"emptyLinePlaceholder":459},[432,989,990],{"class":434,"line":531},[432,991,992],{"class":466},"// Check if a key exists\n",[432,994,995,997,1000,1002,1004,1006,1008,1011,1013,1015],{"class":434,"line":536},[432,996,504],{"class":438},[432,998,999],{"class":507}," exists",[432,1001,511],{"class":438},[432,1003,514],{"class":438},[432,1005,477],{"class":476},[432,1007,480],{"class":442},[432,1009,1010],{"class":476},"hasItem",[432,1012,486],{"class":442},[432,1014,489],{"class":449},[432,1016,528],{"class":442},[432,1018,1019],{"class":434,"line":542},[432,1020,460],{"emptyLinePlaceholder":459},[432,1022,1023],{"class":434,"line":561},[432,1024,1025],{"class":466},"// Remove a key\n",[432,1027,1028,1030,1032,1034,1037,1039,1041],{"class":434,"line":582},[432,1029,473],{"class":438},[432,1031,477],{"class":476},[432,1033,480],{"class":442},[432,1035,1036],{"class":476},"removeItem",[432,1038,486],{"class":442},[432,1040,489],{"class":449},[432,1042,528],{"class":442},[432,1044,1045],{"class":434,"line":601},[432,1046,460],{"emptyLinePlaceholder":459},[432,1048,1049],{"class":434,"line":606},[432,1050,1051],{"class":466},"// Get raw binary data\n",[432,1053,1054,1056,1059,1061,1063,1065,1067,1070,1072,1075],{"class":434,"line":612},[432,1055,504],{"class":438},[432,1057,1058],{"class":507}," raw",[432,1060,511],{"class":438},[432,1062,514],{"class":438},[432,1064,477],{"class":476},[432,1066,480],{"class":442},[432,1068,1069],{"class":476},"getItemRaw",[432,1071,486],{"class":442},[432,1073,1074],{"class":449},"\"assets/server:image.png\"",[432,1076,528],{"class":442},[432,1078,1079],{"class":434,"line":648},[432,1080,460],{"emptyLinePlaceholder":459},[432,1082,1084],{"class":434,"line":1083},15,[432,1085,1086],{"class":466},"// Get metadata (type, etag, mtime, etc.)\n",[432,1088,1090,1092,1095,1097,1099,1101,1103,1106,1108,1111,1113,1116],{"class":434,"line":1089},16,[432,1091,504],{"class":438},[432,1093,1094],{"class":507}," meta",[432,1096,511],{"class":438},[432,1098,514],{"class":438},[432,1100,477],{"class":476},[432,1102,486],{"class":442},[432,1104,1105],{"class":449},"\"assets/server\"",[432,1107,637],{"class":442},[432,1109,1110],{"class":476},"getMeta",[432,1112,486],{"class":442},[432,1114,1115],{"class":449},"\"file.txt\"",[432,1117,528],{"class":442},[411,1119,33],{"id":1120},"configuration",[399,1122,1123,1124,1127],{},"You can mount one or multiple custom storage drivers using the ",[419,1125,1126],{},"storage"," option.",[399,1129,1130],{},"The key is the mount point name, and the value is the driver name and configuration.",[424,1132,1135],{"className":426,"code":1133,"filename":1134,"language":428,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  storage: {\n    redis: {\n      driver: \"redis\",\n      /* redis connector options */\n    }\n  }\n})\n","nitro.config.ts",[419,1136,1137,1151,1155,1169,1174,1179,1190,1195,1200,1205],{"__ignoreMap":5},[432,1138,1139,1141,1144,1146,1149],{"class":434,"line":435},[432,1140,439],{"class":438},[432,1142,1143],{"class":442}," { defineNitroConfig } ",[432,1145,446],{"class":438},[432,1147,1148],{"class":449}," \"nitro/config\"",[432,1150,453],{"class":442},[432,1152,1153],{"class":434,"line":456},[432,1154,460],{"emptyLinePlaceholder":459},[432,1156,1157,1160,1163,1166],{"class":434,"line":463},[432,1158,1159],{"class":438},"export",[432,1161,1162],{"class":438}," default",[432,1164,1165],{"class":476}," defineNitroConfig",[432,1167,1168],{"class":442},"({\n",[432,1170,1171],{"class":434,"line":470},[432,1172,1173],{"class":442},"  storage: {\n",[432,1175,1176],{"class":434,"line":501},[432,1177,1178],{"class":442},"    redis: {\n",[432,1180,1181,1184,1187],{"class":434,"line":531},[432,1182,1183],{"class":442},"      driver: ",[432,1185,1186],{"class":449},"\"redis\"",[432,1188,1189],{"class":442},",\n",[432,1191,1192],{"class":434,"line":536},[432,1193,1194],{"class":466},"      /* redis connector options */\n",[432,1196,1197],{"class":434,"line":542},[432,1198,1199],{"class":442},"    }\n",[432,1201,1202],{"class":434,"line":561},[432,1203,1204],{"class":442},"  }\n",[432,1206,1207],{"class":434,"line":582},[432,1208,1209],{"class":442},"})\n",[399,1211,1212,1213,1216],{},"Then, you can use the redis storage using the ",[419,1214,1215],{},"useStorage(\"redis\")"," function.",[676,1218,1220],{"to":1219},"https://unstorage.unjs.io/",[399,1221,1222,1223,1227],{},"You can find the driver list on ",[403,1224,1226],{"href":1219,"rel":1225},[407],"unstorage documentation"," with their configuration.",[679,1229,1231],{"id":1230},"development-storage","Development storage",[399,1233,1234,1235,1238],{},"You can use the ",[419,1236,1237],{},"devStorage"," option to override storage configuration during development and prerendering.",[399,1240,1241],{},"This is useful when your production driver is not available in development (e.g., a managed Redis instance).",[424,1243,1245],{"className":426,"code":1244,"filename":1134,"language":428,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  storage: {\n    db: {\n      driver: \"redis\",\n      host: \"prod.example.com\",\n    }\n  },\n  devStorage: {\n    db: {\n      driver: \"fs\",\n      base: \"./.data/db\"\n    }\n  }\n})\n",[419,1246,1247,1259,1263,1273,1277,1282,1290,1300,1304,1309,1314,1318,1327,1335,1339,1343],{"__ignoreMap":5},[432,1248,1249,1251,1253,1255,1257],{"class":434,"line":435},[432,1250,439],{"class":438},[432,1252,1143],{"class":442},[432,1254,446],{"class":438},[432,1256,1148],{"class":449},[432,1258,453],{"class":442},[432,1260,1261],{"class":434,"line":456},[432,1262,460],{"emptyLinePlaceholder":459},[432,1264,1265,1267,1269,1271],{"class":434,"line":463},[432,1266,1159],{"class":438},[432,1268,1162],{"class":438},[432,1270,1165],{"class":476},[432,1272,1168],{"class":442},[432,1274,1275],{"class":434,"line":470},[432,1276,1173],{"class":442},[432,1278,1279],{"class":434,"line":501},[432,1280,1281],{"class":442},"    db: {\n",[432,1283,1284,1286,1288],{"class":434,"line":531},[432,1285,1183],{"class":442},[432,1287,1186],{"class":449},[432,1289,1189],{"class":442},[432,1291,1292,1295,1298],{"class":434,"line":536},[432,1293,1294],{"class":442},"      host: ",[432,1296,1297],{"class":449},"\"prod.example.com\"",[432,1299,1189],{"class":442},[432,1301,1302],{"class":434,"line":542},[432,1303,1199],{"class":442},[432,1305,1306],{"class":434,"line":561},[432,1307,1308],{"class":442},"  },\n",[432,1310,1311],{"class":434,"line":582},[432,1312,1313],{"class":442},"  devStorage: {\n",[432,1315,1316],{"class":434,"line":601},[432,1317,1281],{"class":442},[432,1319,1320,1322,1325],{"class":434,"line":606},[432,1321,1183],{"class":442},[432,1323,1324],{"class":449},"\"fs\"",[432,1326,1189],{"class":442},[432,1328,1329,1332],{"class":434,"line":612},[432,1330,1331],{"class":442},"      base: ",[432,1333,1334],{"class":449},"\"./.data/db\"\n",[432,1336,1337],{"class":434,"line":648},[432,1338,1199],{"class":442},[432,1340,1341],{"class":434,"line":1083},[432,1342,1204],{"class":442},[432,1344,1345],{"class":434,"line":1089},[432,1346,1209],{"class":442},[399,1348,1349,1350,1352,1353,1355],{},"When running in development mode, ",[419,1351,1237],{}," mounts are merged on top of ",[419,1354,1126],{}," mounts, allowing you to use a local filesystem driver or an in-memory driver while developing.",[411,1357,1359],{"id":1358},"built-in-mount-points","Built-in mount points",[399,1361,1362],{},"Nitro automatically mounts the following storage paths:",[679,1364,1366],{"id":1365},"assets",[419,1367,1368],{},"/assets",[399,1370,1371,1372,1374,1375,637],{},"Server assets are mounted at the ",[419,1373,1368],{}," base path. This mount point provides read-only access to bundled server assets (see ",[403,1376,1378],{"href":1377},"#server-assets","Server assets",[424,1380,1382],{"className":426,"code":1381,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\n\n// Access server assets via the /assets mount\nconst content = await useStorage(\"assets/server\").getItem(\"my-file.txt\");\n",[419,1383,1384,1396,1400,1405],{"__ignoreMap":5},[432,1385,1386,1388,1390,1392,1394],{"class":434,"line":435},[432,1387,439],{"class":438},[432,1389,443],{"class":442},[432,1391,446],{"class":438},[432,1393,450],{"class":449},[432,1395,453],{"class":442},[432,1397,1398],{"class":434,"line":456},[432,1399,460],{"emptyLinePlaceholder":459},[432,1401,1402],{"class":434,"line":463},[432,1403,1404],{"class":466},"// Access server assets via the /assets mount\n",[432,1406,1407,1409,1412,1414,1416,1418,1420,1422,1424,1426,1428,1431],{"class":434,"line":470},[432,1408,504],{"class":438},[432,1410,1411],{"class":507}," content",[432,1413,511],{"class":438},[432,1415,514],{"class":438},[432,1417,477],{"class":476},[432,1419,486],{"class":442},[432,1421,1105],{"class":449},[432,1423,637],{"class":442},[432,1425,521],{"class":476},[432,1427,486],{"class":442},[432,1429,1430],{"class":449},"\"my-file.txt\"",[432,1432,528],{"class":442},[679,1434,1436],{"id":1435},"default-in-memory","Default (in-memory)",[399,1438,1439],{},"The root storage (without a base path) uses an in-memory driver by default. Data stored here is not persisted across restarts.",[424,1441,1443],{"className":426,"code":1442,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\n\n// In-memory by default, not persisted\nawait useStorage().setItem(\"counter\", 1);\n",[419,1444,1445,1457,1461,1466],{"__ignoreMap":5},[432,1446,1447,1449,1451,1453,1455],{"class":434,"line":435},[432,1448,439],{"class":438},[432,1450,443],{"class":442},[432,1452,446],{"class":438},[432,1454,450],{"class":449},[432,1456,453],{"class":442},[432,1458,1459],{"class":434,"line":456},[432,1460,460],{"emptyLinePlaceholder":459},[432,1462,1463],{"class":434,"line":463},[432,1464,1465],{"class":466},"// In-memory by default, not persisted\n",[432,1467,1468,1470,1472,1474,1476,1478,1481,1483,1486],{"class":434,"line":470},[432,1469,473],{"class":438},[432,1471,477],{"class":476},[432,1473,480],{"class":442},[432,1475,483],{"class":476},[432,1477,486],{"class":442},[432,1479,1480],{"class":449},"\"counter\"",[432,1482,833],{"class":442},[432,1484,1485],{"class":507},"1",[432,1487,528],{"class":442},[399,1489,1490,1491,833,1494,1497,1498,1500],{},"To persist data, mount a driver with a persistent backend (e.g., ",[419,1492,1493],{},"fs",[419,1495,1496],{},"redis",", etc.) using the ",[419,1499,1126],{}," configuration option.",[411,1502,1378],{"id":1503},"server-assets",[399,1505,1506,1507,1510,1511,1514],{},"Nitro allows you to bundle files from an ",[419,1508,1509],{},"assets/"," directory at the root of your project. These files are accessible at runtime via the ",[419,1512,1513],{},"assets/server"," storage mount.",[424,1516,1521],{"className":1517,"code":1519,"language":1520},[1518],"language-text","my-project/\n  assets/\n    data.json\n    templates/\n      welcome.html\n  server/\n    routes/\n      index.ts\n","text",[419,1522,1519],{"__ignoreMap":5},[424,1524,1527],{"className":426,"code":1525,"filename":1526,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\n\nexport default defineHandler(async () => {\n  const serverAssets = useStorage(\"assets/server\");\n\n  const keys = await serverAssets.getKeys();\n  const data = await serverAssets.getItem(\"data.json\");\n  const template = await serverAssets.getItem(\"templates/welcome.html\");\n\n  return { keys, data, template };\n});\n","server/routes/index.ts",[419,1528,1529,1541,1545,1568,1586,1590,1607,1629,1651,1655,1663],{"__ignoreMap":5},[432,1530,1531,1533,1535,1537,1539],{"class":434,"line":435},[432,1532,439],{"class":438},[432,1534,443],{"class":442},[432,1536,446],{"class":438},[432,1538,450],{"class":449},[432,1540,453],{"class":442},[432,1542,1543],{"class":434,"line":456},[432,1544,460],{"emptyLinePlaceholder":459},[432,1546,1547,1549,1551,1554,1556,1559,1562,1565],{"class":434,"line":463},[432,1548,1159],{"class":438},[432,1550,1162],{"class":438},[432,1552,1553],{"class":476}," defineHandler",[432,1555,486],{"class":442},[432,1557,1558],{"class":438},"async",[432,1560,1561],{"class":442}," () ",[432,1563,1564],{"class":438},"=>",[432,1566,1567],{"class":442}," {\n",[432,1569,1570,1573,1576,1578,1580,1582,1584],{"class":434,"line":470},[432,1571,1572],{"class":438},"  const",[432,1574,1575],{"class":507}," serverAssets",[432,1577,511],{"class":438},[432,1579,477],{"class":476},[432,1581,486],{"class":442},[432,1583,1105],{"class":449},[432,1585,528],{"class":442},[432,1587,1588],{"class":434,"line":501},[432,1589,460],{"emptyLinePlaceholder":459},[432,1591,1592,1594,1596,1598,1600,1603,1605],{"class":434,"line":531},[432,1593,1572],{"class":438},[432,1595,965],{"class":507},[432,1597,511],{"class":438},[432,1599,514],{"class":438},[432,1601,1602],{"class":442}," serverAssets.",[432,1604,980],{"class":476},[432,1606,983],{"class":442},[432,1608,1609,1611,1614,1616,1618,1620,1622,1624,1627],{"class":434,"line":536},[432,1610,1572],{"class":438},[432,1612,1613],{"class":507}," data",[432,1615,511],{"class":438},[432,1617,514],{"class":438},[432,1619,1602],{"class":442},[432,1621,521],{"class":476},[432,1623,486],{"class":442},[432,1625,1626],{"class":449},"\"data.json\"",[432,1628,528],{"class":442},[432,1630,1631,1633,1636,1638,1640,1642,1644,1646,1649],{"class":434,"line":542},[432,1632,1572],{"class":438},[432,1634,1635],{"class":507}," template",[432,1637,511],{"class":438},[432,1639,514],{"class":438},[432,1641,1602],{"class":442},[432,1643,521],{"class":476},[432,1645,486],{"class":442},[432,1647,1648],{"class":449},"\"templates/welcome.html\"",[432,1650,528],{"class":442},[432,1652,1653],{"class":434,"line":561},[432,1654,460],{"emptyLinePlaceholder":459},[432,1656,1657,1660],{"class":434,"line":582},[432,1658,1659],{"class":438},"  return",[432,1661,1662],{"class":442}," { keys, data, template };\n",[432,1664,1665],{"class":434,"line":601},[432,1666,1667],{"class":442},"});\n",[679,1669,1671],{"id":1670},"custom-asset-directories","Custom asset directories",[399,1673,1674,1675,1678],{},"You can register additional asset directories using the ",[419,1676,1677],{},"serverAssets"," config option:",[424,1680,1682],{"className":426,"code":1681,"filename":1134,"language":428,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  serverAssets: [\n    {\n      baseName: \"templates\",\n      dir: \"./templates\",\n    }\n  ]\n})\n",[419,1683,1684,1696,1700,1710,1715,1720,1730,1740,1744,1749],{"__ignoreMap":5},[432,1685,1686,1688,1690,1692,1694],{"class":434,"line":435},[432,1687,439],{"class":438},[432,1689,1143],{"class":442},[432,1691,446],{"class":438},[432,1693,1148],{"class":449},[432,1695,453],{"class":442},[432,1697,1698],{"class":434,"line":456},[432,1699,460],{"emptyLinePlaceholder":459},[432,1701,1702,1704,1706,1708],{"class":434,"line":463},[432,1703,1159],{"class":438},[432,1705,1162],{"class":438},[432,1707,1165],{"class":476},[432,1709,1168],{"class":442},[432,1711,1712],{"class":434,"line":470},[432,1713,1714],{"class":442},"  serverAssets: [\n",[432,1716,1717],{"class":434,"line":501},[432,1718,1719],{"class":442},"    {\n",[432,1721,1722,1725,1728],{"class":434,"line":531},[432,1723,1724],{"class":442},"      baseName: ",[432,1726,1727],{"class":449},"\"templates\"",[432,1729,1189],{"class":442},[432,1731,1732,1735,1738],{"class":434,"line":536},[432,1733,1734],{"class":442},"      dir: ",[432,1736,1737],{"class":449},"\"./templates\"",[432,1739,1189],{"class":442},[432,1741,1742],{"class":434,"line":542},[432,1743,1199],{"class":442},[432,1745,1746],{"class":434,"line":561},[432,1747,1748],{"class":442},"  ]\n",[432,1750,1751],{"class":434,"line":582},[432,1752,1209],{"class":442},[399,1754,1755,1756,626],{},"Custom asset directories are accessible under ",[419,1757,1758],{},"assets/\u003CbaseName>",[424,1760,1762],{"className":426,"code":1761,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\n\nconst templates = useStorage(\"assets/templates\");\nconst keys = await templates.getKeys();\nconst html = await templates.getItem(\"email.html\");\n",[419,1763,1764,1776,1780,1798,1815],{"__ignoreMap":5},[432,1765,1766,1768,1770,1772,1774],{"class":434,"line":435},[432,1767,439],{"class":438},[432,1769,443],{"class":442},[432,1771,446],{"class":438},[432,1773,450],{"class":449},[432,1775,453],{"class":442},[432,1777,1778],{"class":434,"line":456},[432,1779,460],{"emptyLinePlaceholder":459},[432,1781,1782,1784,1787,1789,1791,1793,1796],{"class":434,"line":463},[432,1783,504],{"class":438},[432,1785,1786],{"class":507}," templates",[432,1788,511],{"class":438},[432,1790,477],{"class":476},[432,1792,486],{"class":442},[432,1794,1795],{"class":449},"\"assets/templates\"",[432,1797,528],{"class":442},[432,1799,1800,1802,1804,1806,1808,1811,1813],{"class":434,"line":470},[432,1801,504],{"class":438},[432,1803,965],{"class":507},[432,1805,511],{"class":438},[432,1807,514],{"class":438},[432,1809,1810],{"class":442}," templates.",[432,1812,980],{"class":476},[432,1814,983],{"class":442},[432,1816,1817,1819,1822,1824,1826,1828,1830,1832,1835],{"class":434,"line":501},[432,1818,504],{"class":438},[432,1820,1821],{"class":507}," html",[432,1823,511],{"class":438},[432,1825,514],{"class":438},[432,1827,1810],{"class":442},[432,1829,521],{"class":476},[432,1831,486],{"class":442},[432,1833,1834],{"class":449},"\"email.html\"",[432,1836,528],{"class":442},[679,1838,1840],{"id":1839},"asset-metadata","Asset metadata",[399,1842,1843],{},"Server assets include metadata such as content type, ETag, and modification time:",[424,1845,1847],{"className":426,"code":1846,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\n\nconst serverAssets = useStorage(\"assets/server\");\n\nconst meta = await serverAssets.getMeta(\"image.png\");\n// { type: \"image/png\", etag: \"\\\"...\\\"\", mtime: \"2024-01-01T00:00:00.000Z\" }\n\n// Useful for setting response headers\nconst raw = await serverAssets.getItemRaw(\"image.png\");\n",[419,1848,1849,1861,1865,1881,1885,1906,1911,1915,1920],{"__ignoreMap":5},[432,1850,1851,1853,1855,1857,1859],{"class":434,"line":435},[432,1852,439],{"class":438},[432,1854,443],{"class":442},[432,1856,446],{"class":438},[432,1858,450],{"class":449},[432,1860,453],{"class":442},[432,1862,1863],{"class":434,"line":456},[432,1864,460],{"emptyLinePlaceholder":459},[432,1866,1867,1869,1871,1873,1875,1877,1879],{"class":434,"line":463},[432,1868,504],{"class":438},[432,1870,1575],{"class":507},[432,1872,511],{"class":438},[432,1874,477],{"class":476},[432,1876,486],{"class":442},[432,1878,1105],{"class":449},[432,1880,528],{"class":442},[432,1882,1883],{"class":434,"line":470},[432,1884,460],{"emptyLinePlaceholder":459},[432,1886,1887,1889,1891,1893,1895,1897,1899,1901,1904],{"class":434,"line":501},[432,1888,504],{"class":438},[432,1890,1094],{"class":507},[432,1892,511],{"class":438},[432,1894,514],{"class":438},[432,1896,1602],{"class":442},[432,1898,1110],{"class":476},[432,1900,486],{"class":442},[432,1902,1903],{"class":449},"\"image.png\"",[432,1905,528],{"class":442},[432,1907,1908],{"class":434,"line":531},[432,1909,1910],{"class":466},"// { type: \"image/png\", etag: \"\\\"...\\\"\", mtime: \"2024-01-01T00:00:00.000Z\" }\n",[432,1912,1913],{"class":434,"line":536},[432,1914,460],{"emptyLinePlaceholder":459},[432,1916,1917],{"class":434,"line":542},[432,1918,1919],{"class":466},"// Useful for setting response headers\n",[432,1921,1922,1924,1926,1928,1930,1932,1934,1936,1938],{"class":434,"line":561},[432,1923,504],{"class":438},[432,1925,1058],{"class":507},[432,1927,511],{"class":438},[432,1929,514],{"class":438},[432,1931,1602],{"class":442},[432,1933,1069],{"class":476},[432,1935,486],{"class":442},[432,1937,1903],{"class":449},[432,1939,528],{"class":442},[1941,1942,1943],"note",{},[399,1944,1945],{},"In development, server assets are read directly from the filesystem. In production, they are bundled and inlined into the build output.",[411,1947,1949],{"id":1948},"runtime-configuration","Runtime configuration",[399,1951,1952,1953,901],{},"In scenarios where the mount point configuration is not known until runtime, Nitro can dynamically add mount points during startup using ",[403,1954,1955],{"href":49},"plugins",[424,1957,1960],{"className":426,"code":1958,"filename":1959,"language":428,"meta":5,"style":5},"import { useStorage } from \"nitro/storage\";\nimport { definePlugin } from \"nitro\";\nimport redisDriver from \"unstorage/drivers/redis\";\n\nexport default definePlugin(() => {\n  const storage = useStorage()\n\n  // Dynamically pass in credentials from runtime configuration, or other sources\n  const driver = redisDriver({\n    base: \"redis\",\n    host: process.env.REDIS_HOST,\n    port: process.env.REDIS_PORT,\n    /* other redis connector options */\n  })\n\n  // Mount driver\n  storage.mount(\"redis\", driver)\n})\n","plugins/storage.ts",[419,1961,1962,1974,1988,2002,2006,2022,2036,2040,2045,2059,2068,2078,2088,2093,2098,2102,2107,2123],{"__ignoreMap":5},[432,1963,1964,1966,1968,1970,1972],{"class":434,"line":435},[432,1965,439],{"class":438},[432,1967,443],{"class":442},[432,1969,446],{"class":438},[432,1971,450],{"class":449},[432,1973,453],{"class":442},[432,1975,1976,1978,1981,1983,1986],{"class":434,"line":456},[432,1977,439],{"class":438},[432,1979,1980],{"class":442}," { definePlugin } ",[432,1982,446],{"class":438},[432,1984,1985],{"class":449}," \"nitro\"",[432,1987,453],{"class":442},[432,1989,1990,1992,1995,1997,2000],{"class":434,"line":463},[432,1991,439],{"class":438},[432,1993,1994],{"class":442}," redisDriver ",[432,1996,446],{"class":438},[432,1998,1999],{"class":449}," \"unstorage/drivers/redis\"",[432,2001,453],{"class":442},[432,2003,2004],{"class":434,"line":470},[432,2005,460],{"emptyLinePlaceholder":459},[432,2007,2008,2010,2012,2015,2018,2020],{"class":434,"line":501},[432,2009,1159],{"class":438},[432,2011,1162],{"class":438},[432,2013,2014],{"class":476}," definePlugin",[432,2016,2017],{"class":442},"(() ",[432,2019,1564],{"class":438},[432,2021,1567],{"class":442},[432,2023,2024,2026,2029,2031,2033],{"class":434,"line":531},[432,2025,1572],{"class":438},[432,2027,2028],{"class":507}," storage",[432,2030,511],{"class":438},[432,2032,477],{"class":476},[432,2034,2035],{"class":442},"()\n",[432,2037,2038],{"class":434,"line":536},[432,2039,460],{"emptyLinePlaceholder":459},[432,2041,2042],{"class":434,"line":542},[432,2043,2044],{"class":466},"  // Dynamically pass in credentials from runtime configuration, or other sources\n",[432,2046,2047,2049,2052,2054,2057],{"class":434,"line":561},[432,2048,1572],{"class":438},[432,2050,2051],{"class":507}," driver",[432,2053,511],{"class":438},[432,2055,2056],{"class":476}," redisDriver",[432,2058,1168],{"class":442},[432,2060,2061,2064,2066],{"class":434,"line":582},[432,2062,2063],{"class":442},"    base: ",[432,2065,1186],{"class":449},[432,2067,1189],{"class":442},[432,2069,2070,2073,2076],{"class":434,"line":601},[432,2071,2072],{"class":442},"    host: process.env.",[432,2074,2075],{"class":507},"REDIS_HOST",[432,2077,1189],{"class":442},[432,2079,2080,2083,2086],{"class":434,"line":606},[432,2081,2082],{"class":442},"    port: process.env.",[432,2084,2085],{"class":507},"REDIS_PORT",[432,2087,1189],{"class":442},[432,2089,2090],{"class":434,"line":612},[432,2091,2092],{"class":466},"    /* other redis connector options */\n",[432,2094,2095],{"class":434,"line":648},[432,2096,2097],{"class":442},"  })\n",[432,2099,2100],{"class":434,"line":1083},[432,2101,460],{"emptyLinePlaceholder":459},[432,2103,2104],{"class":434,"line":1089},[432,2105,2106],{"class":466},"  // Mount driver\n",[432,2108,2110,2113,2116,2118,2120],{"class":434,"line":2109},17,[432,2111,2112],{"class":442},"  storage.",[432,2114,2115],{"class":476},"mount",[432,2117,486],{"class":442},[432,2119,1186],{"class":449},[432,2121,2122],{"class":442},", driver)\n",[432,2124,2126],{"class":434,"line":2125},18,[432,2127,1209],{"class":442},[2129,2130,2131],"warning",{},[399,2132,2133,2134,901],{},"This is a temporary workaround, with a better solution coming in the future! Keep a lookout on the GitHub issue ",[403,2135,2138],{"href":2136,"rel":2137},"https://github.com/nitrojs/nitro/issues/1161#issuecomment-1511444675",[407],"here",[2140,2141,2142],"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 .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}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 pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}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":5,"searchDepth":456,"depth":456,"links":2144},[2145,2148,2151,2155,2159],{"id":413,"depth":456,"text":414,"children":2146},[2147],{"id":681,"depth":463,"text":682},{"id":1120,"depth":456,"text":33,"children":2149},[2150],{"id":1230,"depth":463,"text":1231},{"id":1358,"depth":456,"text":1359,"children":2152},[2153,2154],{"id":1365,"depth":463,"text":1368},{"id":1435,"depth":463,"text":1436},{"id":1503,"depth":456,"text":1378,"children":2156},[2157,2158],{"id":1670,"depth":463,"text":1671},{"id":1839,"depth":463,"text":1840},{"id":1948,"depth":456,"text":1949},"Nitro provides a built-in storage layer that can abstract filesystem or database or any other data source.","md",{"icon":76},{"icon":76},{"title":73,"description":2160},"Dhm3OI8nVMLGzfnsFCyjolDeAcVeYgYKlHgwSq8HIw0",[2167,2169],{"title":68,"path":69,"stem":70,"description":2168,"icon":71,"children":-1},"Nitro provides a caching system built on top of the storage layer, powered by ocache.",{"title":78,"path":79,"stem":80,"description":5,"icon":81,"children":-1},1775753651785]