[{"data":1,"prerenderedAt":1400,"buildId":1401},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks":3},{"id":4,"title":5,"body":6,"description":1382,"extension":1383,"frontmatter":1384,"heading":1389,"meta":1391,"navigation":1393,"order":1387,"path":1394,"seo":1395,"sitemap":1396,"source":1397,"stem":1398,"__hash__":1399},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks.md","Lifecycle hooks - Every kubb:* build event",{"type":7,"value":8,"toc":1365},"minimark",[9,22,101,106,117,399,403,406,409,413,436,558,562,572,812,826,830,850,1002,1006,1009,1101,1108,1112,1117,1129,1195,1199,1207,1277,1313,1316,1325],[10,11,12,13,17,18,21],"p",{},"Hooks let you run code in every build phase. Each phase fires a ",[14,15,16],"code",{},"kubb:*"," hook on one shared emitter, typed by ",[14,19,20],{},"KubbHooks",". Handlers can be async, and Kubb awaits each one.",[23,24,25,38],"table",{},[26,27,28],"thead",{},[29,30,31,35],"tr",{},[32,33,34],"th",{},"Listener",[32,36,37],{},"Receives",[39,40,41,82],"tbody",{},[29,42,43,55],{},[44,45,46,47,54],"td",{},"A plugin's ",[48,49,51],"a",{"href":50},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fplugins",[14,52,53],{},"hooks"," map",[44,56,57,58,61,62,65,66,69,70,73,74,77,78,81],{},"The hooks from ",[14,59,60],{},"kubb:setup:end"," to ",[14,63,64],{},"kubb:build:end",", including its own ",[14,67,68],{},"kubb:plugin:setup",". It misses the ",[14,71,72],{},"lifecycle"," and ",[14,75,76],{},"generation"," hooks, ",[14,79,80],{},"kubb:setup:start",", and the output passes.",[29,83,84,96],{},[44,85,86,89,90],{},[14,87,88],{},"kubb.hooks.hook(name, handler)"," from ",[48,91,93],{"href":92},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fengine#createkubb",[14,94,95],{},"createKubb",[44,97,98,99],{},"Every hook except ",[14,100,68],{},[102,103,105],"h2",{"id":104},"listening","Listening",[10,107,108,109,112,113,116],{},"Attach listeners before you call ",[14,110,111],{},"build()",". ",[14,114,115],{},"hook()"," returns a function that removes the listener.",[118,119,123],"pre",{"language":120,"code":121,"class":122},"ts","import { createKubb } from 'kubb'\n\nconst kubb = createKubb({\n input: '.\u002FpetStore.yaml',\n output: { path: '.\u002Fgen' },\n})\n\nkubb.hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n console.log(`${plugin.name} finished in ${duration}ms`)\n})\n\nkubb.hooks.hook('kubb:build:end', ({ files }) => {\n console.log(`Generated ${files.length} files`)\n})\n\nawait kubb.build()","highlights",[14,124,126,153,154,153,156,153,173,153,190,153,214,153,219,153,221,153,265,153,310,153,314,153,316,153,346,153,378,153,382,153,384],{"class":125},"language-ts",[127,128,131,135,139,143,146,149],"span",{"class":129,"style":130},"line","display: inline",[127,132,134],{"style":133},"color:#d73a49;--hls-dark:#f97583","import ",[127,136,138],{"style":137},"color:#005cc5;--hls-dark:#79b8ff","{ ",[127,140,142],{"style":141},"color:#24292e;--hls-dark:#e1e4e8","createKubb ",[127,144,145],{"style":137},"} ",[127,147,148],{"style":133},"from ",[127,150,152],{"style":151},"color:#032f62;--hls-dark:#9ecbff","'kubb'","\n",[127,155],{"class":129,"style":130},[127,157,158,161,164,167,170],{"class":129,"style":130},[127,159,160],{"style":133},"const ",[127,162,163],{"style":141},"kubb ",[127,165,166],{"style":133},"= ",[127,168,95],{"style":169},"color:#6f42c1;--hls-dark:#b392f0",[127,171,172],{"style":137},"({",[127,174,175,178,181,184,187],{"class":129,"style":130},[127,176,177],{"style":137}," ",[127,179,180],{"style":137},"input",[127,182,183],{"style":133},": ",[127,185,186],{"style":151},"'.\u002FpetStore.yaml'",[127,188,189],{"style":133},",",[127,191,192,194,197,199,201,204,206,209,212],{"class":129,"style":130},[127,193,177],{"style":133},[127,195,196],{"style":137},"output",[127,198,183],{"style":133},[127,200,138],{"style":137},[127,202,203],{"style":137},"path",[127,205,183],{"style":133},[127,207,208],{"style":151},"'.\u002Fgen' ",[127,210,211],{"style":137},"}",[127,213,189],{"style":133},[127,215,216],{"class":129,"style":130},[127,217,218],{"style":137},"})",[127,220],{"class":129,"style":130},[127,222,223,226,229,231,233,236,239,242,245,248,251,253,256,259,262],{"class":129,"style":130},[127,224,225],{"style":141},"kubb",[127,227,228],{"style":133},".",[127,230,53],{"style":137},[127,232,228],{"style":133},[127,234,235],{"style":169},"hook",[127,237,238],{"style":137},"(",[127,240,241],{"style":151},"'kubb:plugin:end'",[127,243,244],{"style":133},", ",[127,246,247],{"style":137},"({ ",[127,249,250],{"style":141},"plugin",[127,252,244],{"style":133},[127,254,255],{"style":141},"duration ",[127,257,258],{"style":137},"}) ",[127,260,261],{"style":133},"=> ",[127,263,264],{"style":137},"{",[127,266,267,269,272,274,277,279,282,285,287,289,292,294,297,299,302,304,307],{"class":129,"style":130},[127,268,177],{"style":137},[127,270,271],{"style":141},"console",[127,273,228],{"style":133},[127,275,276],{"style":169},"log",[127,278,238],{"style":137},[127,280,281],{"style":151},"`",[127,283,284],{"style":141},"${",[127,286,250],{"style":141},[127,288,228],{"style":133},[127,290,291],{"style":137},"name",[127,293,211],{"style":141},[127,295,296],{"style":151}," finished in ",[127,298,284],{"style":141},[127,300,301],{"style":141},"duration",[127,303,211],{"style":141},[127,305,306],{"style":151},"ms`",[127,308,309],{"style":137},")",[127,311,312],{"class":129,"style":130},[127,313,218],{"style":137},[127,315],{"class":129,"style":130},[127,317,318,320,322,324,326,328,330,333,335,337,340,342,344],{"class":129,"style":130},[127,319,225],{"style":141},[127,321,228],{"style":133},[127,323,53],{"style":137},[127,325,228],{"style":133},[127,327,235],{"style":169},[127,329,238],{"style":137},[127,331,332],{"style":151},"'kubb:build:end'",[127,334,244],{"style":133},[127,336,247],{"style":137},[127,338,339],{"style":141},"files ",[127,341,258],{"style":137},[127,343,261],{"style":133},[127,345,264],{"style":137},[127,347,348,350,352,354,356,358,361,363,366,368,371,373,376],{"class":129,"style":130},[127,349,177],{"style":137},[127,351,271],{"style":141},[127,353,228],{"style":133},[127,355,276],{"style":169},[127,357,238],{"style":137},[127,359,360],{"style":151},"`Generated ",[127,362,284],{"style":141},[127,364,365],{"style":141},"files",[127,367,228],{"style":133},[127,369,370],{"style":137},"length",[127,372,211],{"style":141},[127,374,375],{"style":151}," files`",[127,377,309],{"style":137},[127,379,380],{"class":129,"style":130},[127,381,218],{"style":137},[127,383],{"class":129,"style":130},[127,385,386,389,391,393,396],{"class":129,"style":130},[127,387,388],{"style":133},"await ",[127,390,225],{"style":141},[127,392,228],{"style":133},[127,394,395],{"style":169},"build",[127,397,398],{"style":137},"()",[102,400,402],{"id":401},"firing-order","Firing order",[10,404,405],{},"A full generation run fires the hooks in this order.",[407,408],"lifecycle-timeline",{},[102,410,412],{"id":411},"generation-run","Generation run",[10,414,415,418,419,73,421,424,425,427,428,431,432,435],{},[14,416,417],{},".generate()"," fires the ",[14,420,76],{},[14,422,423],{},"setup"," hooks. The CLI adds the ",[14,426,72],{}," pair around all configs. A direct ",[14,429,430],{},".build()"," or ",[14,433,434],{},".safeBuild()"," fires none of them.",[23,437,438,451],{},[26,439,440],{},[29,441,442,445,448],{},[32,443,444],{},"Hook",[32,446,447],{},"Payload",[32,449,450],{},"Fires",[39,452,453,472,487,499,510,525,546],{},[29,454,455,460,465],{},[44,456,457],{},[14,458,459],{},"kubb:lifecycle:start",[44,461,462],{},[14,463,464],{},"{ version }",[44,466,467,468,471],{},"When ",[14,469,470],{},"kubb generate"," starts, before the first config. CLI only.",[29,473,474,479,484],{},[44,475,476],{},[14,477,478],{},"kubb:generation:start",[44,480,481],{},[14,482,483],{},"{ config }",[44,485,486],{},"When a run begins, before setup.",[29,488,489,493,496],{},[44,490,491],{},[14,492,80],{},[44,494,495],{},"none",[44,497,498],{},"Before the driver and storage are set up.",[29,500,501,505,507],{},[44,502,503],{},[14,504,60],{},[44,506,495],{},[44,508,509],{},"After setup, before the build pipeline.",[29,511,512,517,522],{},[44,513,514],{},[14,515,516],{},"kubb:generation:end",[44,518,519],{},[14,520,521],{},"{ config, storage, status, diagnostics, filesCreated, hrStart }",[44,523,524],{},"When the run finishes, after the output passes.",[29,526,527,532,537],{},[44,528,529],{},[14,530,531],{},"kubb:generation:summary",[44,533,534],{},[14,535,536],{},"{ duration, fileCount, failedPlugins, status }",[44,538,539,540,542,543,545],{},"Right after ",[14,541,516],{},", with the run's totals. ",[14,544,301],{}," is in milliseconds.",[29,547,548,553,555],{},[44,549,550],{},[14,551,552],{},"kubb:lifecycle:end",[44,554,495],{},[44,556,557],{},"After the last config. CLI only.",[102,559,561],{"id":560},"build-pipeline","Build pipeline",[10,563,564,244,566,568,569,571],{},[14,565,417],{},[14,567,430],{},", and ",[14,570,434],{}," all fire these hooks.",[23,573,574,584],{},[26,575,576],{},[29,577,578,580,582],{},[32,579,444],{},[32,581,447],{},[32,583,450],{},[39,585,586,609,623,638,653,667,682,697,712,727,752,779,798],{},[29,587,588,592,600],{},[44,589,590],{},[14,591,68],{},[44,593,594],{},[48,595,597],{"href":596},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fplugins#setup-context",[14,598,599],{},"KubbPluginSetupContext",[44,601,602,603,605,606,228],{},"Once per plugin, after its ",[14,604,423],{}," and before ",[14,607,608],{},"kubb:build:start",[29,610,611,615,620],{},[44,612,613],{},[14,614,608],{},[44,616,617],{},[14,618,619],{},"{ config, adapter, meta, nodeCounts, getPlugin, files, upsertFile }",[44,621,622],{},"When the AST is ready, before plugins run. Skipped when no adapter parsed input.",[29,624,625,630,635],{},[44,626,627],{},[14,628,629],{},"kubb:plugin:start",[44,631,632],{},[14,633,634],{},"{ plugin }",[44,636,637],{},"Before a plugin's templates run.",[29,639,640,645,650],{},[44,641,642],{},[14,643,644],{},"kubb:generate:schema",[44,646,647],{},[14,648,649],{},"(node, ctx)",[44,651,652],{},"For each schema node.",[29,654,655,660,664],{},[44,656,657],{},[14,658,659],{},"kubb:generate:operation",[44,661,662],{},[14,663,649],{},[44,665,666],{},"For each operation node.",[29,668,669,674,679],{},[44,670,671],{},[14,672,673],{},"kubb:generate:operations",[44,675,676],{},[14,677,678],{},"(nodes, ctx)",[44,680,681],{},"Once, with every operation node.",[29,683,684,689,694],{},[44,685,686],{},[14,687,688],{},"kubb:plugin:end",[44,690,691],{},[14,692,693],{},"{ plugin, duration, success, error, config, files, upsertFile }",[44,695,696],{},"After a plugin finishes.",[29,698,699,704,709],{},[44,700,701],{},[14,702,703],{},"kubb:plugins:end",[44,705,706],{},[14,707,708],{},"{ config, files, upsertFile }",[44,710,711],{},"After every plugin, before files reach the storage. Add aggregate files, such as a barrel, here.",[29,713,714,719,724],{},[44,715,716],{},[14,717,718],{},"kubb:files:processing:start",[44,720,721],{},[14,722,723],{},"{ files }",[44,725,726],{},"Before the generated files are written.",[29,728,729,734,738],{},[44,730,731],{},[14,732,733],{},"kubb:files:processing:update",[44,735,736],{},[14,737,723],{},[44,739,740,741,743,744,747,748,751],{},"As files are written. ",[14,742,365],{}," holds progress records (",[14,745,746],{},"{ processed, total, percentage, file, config }","), not ",[14,749,750],{},"FileNode","s.",[29,753,754,759,764],{},[44,755,756],{},[14,757,758],{},"kubb:file:processed",[44,760,761],{},[14,762,763],{},"{ file, source, stored }",[44,765,766,767,770,771,774,775,228],{},"After each file is printed and handed to the storage. ",[14,768,769],{},"stored"," is the previous content, or ",[14,772,773],{},"null",". See ",[48,776,778],{"href":777},"#file-hook-payloads","File hook payloads",[29,780,781,786,791],{},[44,782,783],{},[14,784,785],{},"kubb:files:processing:end",[44,787,788],{},[14,789,790],{},"{ files, unchanged }",[44,792,793,794,797],{},"After every file is written. ",[14,795,796],{},"unchanged"," lists the paths whose content did not change.",[29,799,800,804,809],{},[44,801,802],{},[14,803,64],{},[44,805,806],{},[14,807,808],{},"{ files, config, outputDir }",[44,810,811],{},"After every file is written and the adapter has settled.",[10,813,814,815,818,819,89,822,825],{},"Kit fires the ",[14,816,817],{},"kubb:generate:*"," hooks, not core: only plugins defined with ",[14,820,821],{},"defineExtension",[14,823,824],{},"kubb\u002Fkit"," emit them, and only when an adapter parsed input.",[102,827,829],{"id":828},"output-passes","Output passes",[10,831,832,833,835,836,839,840,244,843,846,847,228],{},"These hooks fire after a build without errors, only from ",[14,834,417],{}," with ",[14,837,838],{},"fsStorage",". Each group fires only when the config sets ",[14,841,842],{},"output.format",[14,844,845],{},"output.lint",", or ",[14,848,849],{},"output.postGenerate",[23,851,852,862],{},[26,853,854],{},[29,855,856,858,860],{},[32,857,444],{},[32,859,447],{},[32,861,450],{},[39,863,864,876,888,900,912,928,946,964,988],{},[29,865,866,871,873],{},[44,867,868],{},[14,869,870],{},"kubb:format:start",[44,872,495],{},[44,874,875],{},"Before the formatter runs.",[29,877,878,883,885],{},[44,879,880],{},[14,881,882],{},"kubb:format:end",[44,884,495],{},[44,886,887],{},"After formatting.",[29,889,890,895,897],{},[44,891,892],{},[14,893,894],{},"kubb:lint:start",[44,896,495],{},[44,898,899],{},"Before the linter runs.",[29,901,902,907,909],{},[44,903,904],{},[14,905,906],{},"kubb:lint:end",[44,908,495],{},[44,910,911],{},"After linting.",[29,913,914,919,921],{},[44,915,916],{},[14,917,918],{},"kubb:hooks:start",[44,920,495],{},[44,922,923,924,927],{},"Before the ",[14,925,926],{},"postGenerate"," commands run.",[29,929,930,935,940],{},[44,931,932],{},[14,933,934],{},"kubb:hook:start",[44,936,937],{},[14,938,939],{},"{ id, command, name, args }",[44,941,942,943,945],{},"Before one ",[14,944,926],{}," command runs.",[29,947,948,953,958],{},[44,949,950],{},[14,951,952],{},"kubb:hook:line",[44,954,955],{},[14,956,957],{},"{ id, line }",[44,959,960,961,963],{},"For each output line of a ",[14,962,926],{}," command.",[29,965,966,971,976],{},[44,967,968],{},[14,969,970],{},"kubb:hook:end",[44,972,973],{},[14,974,975],{},"{ id, command, name, args, success, error }",[44,977,978,979,981,982,73,985,228],{},"After one ",[14,980,926],{}," command finishes. A failed command also carries ",[14,983,984],{},"stdout",[14,986,987],{},"stderr",[29,989,990,995,997],{},[44,991,992],{},[14,993,994],{},"kubb:hooks:end",[44,996,495],{},[44,998,999,1000,963],{},"After every ",[14,1001,926],{},[102,1003,1005],{"id":1004},"messaging","Messaging",[10,1007,1008],{},"These hooks carry log messages and diagnostics, and fire at any point.",[23,1010,1011,1022],{},[26,1012,1013],{},[29,1014,1015,1017,1019],{},[32,1016,444],{},[32,1018,447],{},[32,1020,1021],{},"Fires for",[39,1023,1024,1039,1053,1067,1082],{},[29,1025,1026,1031,1036],{},[44,1027,1028],{},[14,1029,1030],{},"kubb:info",[44,1032,1033],{},[14,1034,1035],{},"{ message, info }",[44,1037,1038],{},"An informational message.",[29,1040,1041,1046,1050],{},[44,1042,1043],{},[14,1044,1045],{},"kubb:success",[44,1047,1048],{},[14,1049,1035],{},[44,1051,1052],{},"A step that completed.",[29,1054,1055,1060,1064],{},[44,1056,1057],{},[14,1058,1059],{},"kubb:warn",[44,1061,1062],{},[14,1063,1035],{},[44,1065,1066],{},"A problem that does not fail the build.",[29,1068,1069,1074,1079],{},[44,1070,1071],{},[14,1072,1073],{},"kubb:error",[44,1075,1076],{},[14,1077,1078],{},"{ error, meta }",[44,1080,1081],{},"An error without a diagnostic code, so its stack survives.",[29,1083,1084,1089,1094],{},[44,1085,1086],{},[14,1087,1088],{},"kubb:diagnostic",[44,1090,1091],{},[14,1092,1093],{},"{ diagnostic }",[44,1095,1096,1097,228],{},"A coded error, warning, or info, or an update notice. See ",[48,1098,1100],{"href":1099},"\u002Fdocs\u002F5.x\u002Freference\u002Fdiagnostics","diagnostics",[10,1102,1103,1107],{},[48,1104,1106],{"href":1105},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Farchitecture#lifecycle","Architecture"," explains the lifecycle.",[102,1109,1111],{"id":1110},"less-common-cases","Less common cases",[1113,1114,1116],"h3",{"id":1115},"hook-listener-scope","Hook listener scope",[10,1118,1119,1120,1122,1123,61,1125,65,1127,228],{},"When your plugin listens through its ",[14,1121,53],{}," map, it gets the hooks from ",[14,1124,60],{},[14,1126,64],{},[14,1128,68],{},[1130,1131,1132,1136,1145,1155,1184],"ul",{},[1133,1134,1135],"li",{},"Kubb adds these listeners during setup and removes them when the build ends.",[1133,1137,1138,1139,73,1141,77,1143,81],{},"They miss the ",[14,1140,72],{},[14,1142,76],{},[14,1144,80],{},[1133,1146,1147,1149,1150,605,1152,1154],{},[14,1148,68],{}," fires once per plugin, after its ",[14,1151,423],{},[14,1153,608],{},". Kubb calls the plugin's own handler directly.",[1133,1156,1157,1158,1161,1162,1165,1166,431,1168,1170,1171,1174,1175,1177,1178,1180,1181,1183],{},"Each listener runs with a context as ",[14,1159,1160],{},"this",", the same object ",[14,1163,1164],{},"useKubb()"," returns. For a hook Kubb fires, such as ",[14,1167,608],{},[14,1169,703],{},", that is the plugin's own visit context, the ",[14,1172,1173],{},"ctx"," its visit hooks get. For a hook fired inside another hook, it is the context of the hook that fired it. The ",[14,1176,817],{}," hooks run with the template context, so ",[14,1179,1160],{}," is the ",[14,1182,1173],{}," argument.",[1133,1185,1186,1188,1189,1191,1192,1194],{},[14,1187,459],{}," fires when ",[14,1190,470],{}," starts, before the first config. ",[14,1193,417],{}," and the bundler plugins skip it.",[1113,1196,1198],{"id":1197},"visit-hooks","Visit hooks",[10,1200,46,1201,1203,1204,228],{},[14,1202,53],{}," map can also hold four visit hooks. Kubb calls them for that plugin only, while it walks the input, and they never reach ",[14,1205,1206],{},"kubb.hooks",[23,1208,1209,1219],{},[26,1210,1211],{},[29,1212,1213,1215,1217],{},[32,1214,444],{},[32,1216,447],{},[32,1218,450],{},[39,1220,1221,1236,1250,1263],{},[29,1222,1223,1228,1233],{},[44,1224,1225],{},[14,1226,1227],{},"kubb:plugin:visit:start",[44,1229,1230],{},[14,1231,1232],{},"(ctx)",[44,1234,1235],{},"Once, before the first schema.",[29,1237,1238,1243,1247],{},[44,1239,1240],{},[14,1241,1242],{},"kubb:plugin:visit:schema",[44,1244,1245],{},[14,1246,649],{},[44,1248,1249],{},"For each schema node, before the operations.",[29,1251,1252,1257,1261],{},[44,1253,1254],{},[14,1255,1256],{},"kubb:plugin:visit:operation",[44,1258,1259],{},[14,1260,649],{},[44,1262,666],{},[29,1264,1265,1270,1274],{},[44,1266,1267],{},[14,1268,1269],{},"kubb:plugin:visit:end",[44,1271,1272],{},[14,1273,1232],{},[44,1275,1276],{},"Once, after the last operation.",[10,1278,1279,1281,1282,244,1285,1288,1289,1292,1293,244,1295,73,1297,1299,1300,1303,1304,89,1306,1308,1309,1312],{},[14,1280,1173],{}," is the template context without ",[14,1283,1284],{},"resolver",[14,1286,1287],{},"getResolver"," and per-node ",[14,1290,1291],{},"options",", which only templates get. ",[14,1294,1160],{},[14,1296,1173],{},[14,1298,1164],{}," are the same object, the one the plugin's other hooks get, and composables such as ",[14,1301,1302],{},"memo()"," work there. A plugin defined with ",[14,1305,821],{},[14,1307,824],{}," runs its templates before its own visit hooks, with a resolver fixed when the walk starts. Each node reaches every plugin in plugin order before the walk moves on. When a visit hook throws, Kubb stops that plugin, reports ",[14,1310,1311],{},"KUBB_PLUGIN_FAILED",", and runs the other plugins to the end. For the schema and operation hooks, the diagnostic names the node it failed on.",[1113,1314,778],{"id":1315},"file-hook-payloads",[10,1317,1318,1319,1321,1322,1324],{},"When you listen to ",[14,1320,758],{},", you get ",[14,1323,763],{}," after each file is printed and handed to the storage.",[23,1326,1327,1337],{},[26,1328,1329],{},[29,1330,1331,1334],{},[32,1332,1333],{},"Field",[32,1335,1336],{},"Holds",[39,1338,1339,1349],{},[29,1340,1341,1346],{},[44,1342,1343],{},[14,1344,1345],{},"source",[44,1347,1348],{},"The text before any output pass.",[29,1350,1351,1355],{},[44,1352,1353],{},[14,1354,769],{},[44,1356,1357,1358,1360,1361,1364],{},"What the storage held at that path, or ",[14,1359,773],{}," when the path was empty or ",[14,1362,1363],{},"output.clean"," emptied its folder.",{"title":1366,"searchDepth":1367,"depth":1367,"links":1368},"",5,[1369,1371,1372,1373,1374,1375,1376],{"id":104,"depth":1370,"text":105},2,{"id":401,"depth":1370,"text":402},{"id":411,"depth":1370,"text":412},{"id":560,"depth":1370,"text":561},{"id":828,"depth":1370,"text":829},{"id":1004,"depth":1370,"text":1005},{"id":1110,"depth":1370,"text":1111,"children":1377},[1378,1380,1381],{"id":1115,"depth":1379,"text":1116},3,{"id":1197,"depth":1379,"text":1198},{"id":1315,"depth":1379,"text":778},"Every kubb:* hook a build fires, its payload, and when it fires. Listen with kubb.hooks.hook(name, handler) or from a plugin's hooks map.","md",{"layout":1385,"title":5,"description":1382,"outline":1386,"order":1387,"navigation":1388},"doc",[1370,1379],11,{"title":1389,"icon":1390},"Lifecycle hooks","i-iconoir-refresh-double",{"layout":1385,"outline":1392},[1370,1379],{"title":1389,"icon":1390},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks",{"title":5,"description":1382},{"loc":1394},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks.md","docs\u002F5.x\u002Freference\u002Fkit\u002Fhooks","pizoNs3rhLOEARnQQewE4BoUfkcEZzH0vDxKq6ler-Q",1795727678246,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]