[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"content:legacy:page:\u002Fcheatsheets\u002Fnest":3,"content:legacy:navigation":1218,"content:legacy:surround:\u002Fcheatsheets\u002Fnest":1503},{"id":4,"title":5,"body":6,"description":1206,"extension":1207,"icon":1208,"meta":1209,"modifiedAt":1210,"navigation":152,"path":1211,"publishedAt":1212,"seo":1213,"sitemap":1214,"stem":1216,"updatedAt":1215,"__hash__":1217},"cheatsheets\u002Fcheatsheets\u002Fnest.md","Nest",{"type":7,"value":8,"toc":1204},"minimark",[9,14,118,122,199,203,382,386,478,482,538,542,624,628,732,736,822,826,914,918,985,989,1054,1058,1120,1124,1181,1185,1200],[10,11,13],"h5",{"id":12},"cli","🚀 CLI",[15,16,21],"pre",{"className":17,"code":18,"language":19,"meta":20,"style":20},"language-bash shiki shiki-themes github-light github-dark","npm i -g @nestjs\u002Fcli\nnest new project-name\nnest generate module users\nnest generate controller users\nnest generate service users\nnest build\nnest start\nnest info\n","bash","",[22,23,24,44,56,70,82,94,102,110],"code",{"__ignoreMap":20},[25,26,29,33,37,41],"span",{"class":27,"line":28},"line",1,[25,30,32],{"class":31},"sScJk","npm",[25,34,36],{"class":35},"sZZnC"," i",[25,38,40],{"class":39},"sj4cs"," -g",[25,42,43],{"class":35}," @nestjs\u002Fcli\n",[25,45,47,50,53],{"class":27,"line":46},2,[25,48,49],{"class":31},"nest",[25,51,52],{"class":35}," new",[25,54,55],{"class":35}," project-name\n",[25,57,59,61,64,67],{"class":27,"line":58},3,[25,60,49],{"class":31},[25,62,63],{"class":35}," generate",[25,65,66],{"class":35}," module",[25,68,69],{"class":35}," users\n",[25,71,73,75,77,80],{"class":27,"line":72},4,[25,74,49],{"class":31},[25,76,63],{"class":35},[25,78,79],{"class":35}," controller",[25,81,69],{"class":35},[25,83,85,87,89,92],{"class":27,"line":84},5,[25,86,49],{"class":31},[25,88,63],{"class":35},[25,90,91],{"class":35}," service",[25,93,69],{"class":35},[25,95,97,99],{"class":27,"line":96},6,[25,98,49],{"class":31},[25,100,101],{"class":35}," build\n",[25,103,105,107],{"class":27,"line":104},7,[25,106,49],{"class":31},[25,108,109],{"class":35}," start\n",[25,111,113,115],{"class":27,"line":112},8,[25,114,49],{"class":31},[25,116,117],{"class":35}," info\n",[10,119,121],{"id":120},"️-module","🏗️ Module",[15,123,127],{"className":124,"code":125,"language":126,"meta":20,"style":20},"language-typescript shiki shiki-themes github-light github-dark","import { Module } from '@nestjs\u002Fcommon';\n\n@Module({\n  imports: [],\n  controllers: [UsersController],\n  providers: [UsersService],\n})\nexport class UsersModule {}\n","typescript",[22,128,129,148,154,165,170,175,180,185],{"__ignoreMap":20},[25,130,131,135,139,142,145],{"class":27,"line":28},[25,132,134],{"class":133},"szBVR","import",[25,136,138],{"class":137},"sVt8B"," { Module } ",[25,140,141],{"class":133},"from",[25,143,144],{"class":35}," '@nestjs\u002Fcommon'",[25,146,147],{"class":137},";\n",[25,149,150],{"class":27,"line":46},[25,151,153],{"emptyLinePlaceholder":152},true,"\n",[25,155,156,159,162],{"class":27,"line":58},[25,157,158],{"class":137},"@",[25,160,161],{"class":31},"Module",[25,163,164],{"class":137},"({\n",[25,166,167],{"class":27,"line":72},[25,168,169],{"class":137},"  imports: [],\n",[25,171,172],{"class":27,"line":84},[25,173,174],{"class":137},"  controllers: [UsersController],\n",[25,176,177],{"class":27,"line":96},[25,178,179],{"class":137},"  providers: [UsersService],\n",[25,181,182],{"class":27,"line":104},[25,183,184],{"class":137},"})\n",[25,186,187,190,193,196],{"class":27,"line":112},[25,188,189],{"class":133},"export",[25,191,192],{"class":133}," class",[25,194,195],{"class":31}," UsersModule",[25,197,198],{"class":137}," {}\n",[10,200,202],{"id":201},"controller","🎮 Controller",[15,204,206],{"className":124,"code":205,"language":126,"meta":20,"style":20},"import { Controller, Get, Post, Body, Param } from '@nestjs\u002Fcommon';\n\n@Controller('users')\nexport class UsersController {\n  @Get()\n  findAll() { \u002F* ... *\u002F }\n\n  @Get(':id')\n  findOne(@Param('id') id: string) { \u002F* ... *\u002F }\n\n  @Post()\n  create(@Body() dto: CreateUserDto) { \u002F* ... *\u002F }\n}\n",[22,207,208,221,225,241,253,264,279,283,296,333,338,348,376],{"__ignoreMap":20},[25,209,210,212,215,217,219],{"class":27,"line":28},[25,211,134],{"class":133},[25,213,214],{"class":137}," { Controller, Get, Post, Body, Param } ",[25,216,141],{"class":133},[25,218,144],{"class":35},[25,220,147],{"class":137},[25,222,223],{"class":27,"line":46},[25,224,153],{"emptyLinePlaceholder":152},[25,226,227,229,232,235,238],{"class":27,"line":58},[25,228,158],{"class":137},[25,230,231],{"class":31},"Controller",[25,233,234],{"class":137},"(",[25,236,237],{"class":35},"'users'",[25,239,240],{"class":137},")\n",[25,242,243,245,247,250],{"class":27,"line":72},[25,244,189],{"class":133},[25,246,192],{"class":133},[25,248,249],{"class":31}," UsersController",[25,251,252],{"class":137}," {\n",[25,254,255,258,261],{"class":27,"line":84},[25,256,257],{"class":137},"  @",[25,259,260],{"class":31},"Get",[25,262,263],{"class":137},"()\n",[25,265,266,269,272,276],{"class":27,"line":96},[25,267,268],{"class":31},"  findAll",[25,270,271],{"class":137},"() { ",[25,273,275],{"class":274},"sJ8bj","\u002F* ... *\u002F",[25,277,278],{"class":137}," }\n",[25,280,281],{"class":27,"line":104},[25,282,153],{"emptyLinePlaceholder":152},[25,284,285,287,289,291,294],{"class":27,"line":112},[25,286,257],{"class":137},[25,288,260],{"class":31},[25,290,234],{"class":137},[25,292,293],{"class":35},"':id'",[25,295,240],{"class":137},[25,297,299,302,305,308,310,313,316,320,323,326,329,331],{"class":27,"line":298},9,[25,300,301],{"class":31},"  findOne",[25,303,304],{"class":137},"(@",[25,306,307],{"class":31},"Param",[25,309,234],{"class":137},[25,311,312],{"class":35},"'id'",[25,314,315],{"class":137},") ",[25,317,319],{"class":318},"s4XuR","id",[25,321,322],{"class":133},":",[25,324,325],{"class":39}," string",[25,327,328],{"class":137},") { ",[25,330,275],{"class":274},[25,332,278],{"class":137},[25,334,336],{"class":27,"line":335},10,[25,337,153],{"emptyLinePlaceholder":152},[25,339,341,343,346],{"class":27,"line":340},11,[25,342,257],{"class":137},[25,344,345],{"class":31},"Post",[25,347,263],{"class":137},[25,349,351,354,356,359,362,365,367,370,372,374],{"class":27,"line":350},12,[25,352,353],{"class":31},"  create",[25,355,304],{"class":137},[25,357,358],{"class":31},"Body",[25,360,361],{"class":137},"() ",[25,363,364],{"class":318},"dto",[25,366,322],{"class":133},[25,368,369],{"class":31}," CreateUserDto",[25,371,328],{"class":137},[25,373,275],{"class":274},[25,375,278],{"class":137},[25,377,379],{"class":27,"line":378},13,[25,380,381],{"class":137},"}\n",[10,383,385],{"id":384},"️-service","⚙️ Service",[15,387,389],{"className":124,"code":388,"language":126,"meta":20,"style":20},"import { Injectable } from '@nestjs\u002Fcommon';\n\n@Injectable()\nexport class UsersService {\n  findAll() { \u002F* ... *\u002F }\n  findOne(id: string) { \u002F* ... *\u002F }\n  create(dto: CreateUserDto) { \u002F* ... *\u002F }\n}\n",[22,390,391,404,408,417,428,438,456,474],{"__ignoreMap":20},[25,392,393,395,398,400,402],{"class":27,"line":28},[25,394,134],{"class":133},[25,396,397],{"class":137}," { Injectable } ",[25,399,141],{"class":133},[25,401,144],{"class":35},[25,403,147],{"class":137},[25,405,406],{"class":27,"line":46},[25,407,153],{"emptyLinePlaceholder":152},[25,409,410,412,415],{"class":27,"line":58},[25,411,158],{"class":137},[25,413,414],{"class":31},"Injectable",[25,416,263],{"class":137},[25,418,419,421,423,426],{"class":27,"line":72},[25,420,189],{"class":133},[25,422,192],{"class":133},[25,424,425],{"class":31}," UsersService",[25,427,252],{"class":137},[25,429,430,432,434,436],{"class":27,"line":84},[25,431,268],{"class":31},[25,433,271],{"class":137},[25,435,275],{"class":274},[25,437,278],{"class":137},[25,439,440,442,444,446,448,450,452,454],{"class":27,"line":96},[25,441,301],{"class":31},[25,443,234],{"class":137},[25,445,319],{"class":318},[25,447,322],{"class":133},[25,449,325],{"class":39},[25,451,328],{"class":137},[25,453,275],{"class":274},[25,455,278],{"class":137},[25,457,458,460,462,464,466,468,470,472],{"class":27,"line":104},[25,459,353],{"class":31},[25,461,234],{"class":137},[25,463,364],{"class":318},[25,465,322],{"class":133},[25,467,369],{"class":31},[25,469,328],{"class":137},[25,471,275],{"class":274},[25,473,278],{"class":137},[25,475,476],{"class":27,"line":112},[25,477,381],{"class":137},[10,479,481],{"id":480},"️-provider-dependency-injection","🛡️ Provider & Dependency Injection",[15,483,485],{"className":124,"code":484,"language":126,"meta":20,"style":20},"@Injectable()\nexport class MyProvider {}\n\n@Module({\n  providers: [MyProvider],\n})\nexport class AppModule {}\n",[22,486,487,495,506,510,518,523,527],{"__ignoreMap":20},[25,488,489,491,493],{"class":27,"line":28},[25,490,158],{"class":137},[25,492,414],{"class":31},[25,494,263],{"class":137},[25,496,497,499,501,504],{"class":27,"line":46},[25,498,189],{"class":133},[25,500,192],{"class":133},[25,502,503],{"class":31}," MyProvider",[25,505,198],{"class":137},[25,507,508],{"class":27,"line":58},[25,509,153],{"emptyLinePlaceholder":152},[25,511,512,514,516],{"class":27,"line":72},[25,513,158],{"class":137},[25,515,161],{"class":31},[25,517,164],{"class":137},[25,519,520],{"class":27,"line":84},[25,521,522],{"class":137},"  providers: [MyProvider],\n",[25,524,525],{"class":27,"line":96},[25,526,184],{"class":137},[25,528,529,531,533,536],{"class":27,"line":104},[25,530,189],{"class":133},[25,532,192],{"class":133},[25,534,535],{"class":31}," AppModule",[25,537,198],{"class":137},[10,539,541],{"id":540},"️-dto-validation","🗄️ DTO & Validation",[15,543,545],{"className":124,"code":544,"language":126,"meta":20,"style":20},"import { IsString, IsInt } from 'class-validator';\n\nexport class CreateUserDto {\n  @IsString()\n  name: string;\n\n  @IsInt()\n  age: number;\n}\n",[22,546,547,561,565,575,584,595,599,608,620],{"__ignoreMap":20},[25,548,549,551,554,556,559],{"class":27,"line":28},[25,550,134],{"class":133},[25,552,553],{"class":137}," { IsString, IsInt } ",[25,555,141],{"class":133},[25,557,558],{"class":35}," 'class-validator'",[25,560,147],{"class":137},[25,562,563],{"class":27,"line":46},[25,564,153],{"emptyLinePlaceholder":152},[25,566,567,569,571,573],{"class":27,"line":58},[25,568,189],{"class":133},[25,570,192],{"class":133},[25,572,369],{"class":31},[25,574,252],{"class":137},[25,576,577,579,582],{"class":27,"line":72},[25,578,257],{"class":137},[25,580,581],{"class":31},"IsString",[25,583,263],{"class":137},[25,585,586,589,591,593],{"class":27,"line":84},[25,587,588],{"class":318},"  name",[25,590,322],{"class":133},[25,592,325],{"class":39},[25,594,147],{"class":137},[25,596,597],{"class":27,"line":96},[25,598,153],{"emptyLinePlaceholder":152},[25,600,601,603,606],{"class":27,"line":104},[25,602,257],{"class":137},[25,604,605],{"class":31},"IsInt",[25,607,263],{"class":137},[25,609,610,613,615,618],{"class":27,"line":112},[25,611,612],{"class":318},"  age",[25,614,322],{"class":133},[25,616,617],{"class":39}," number",[25,619,147],{"class":137},[25,621,622],{"class":27,"line":298},[25,623,381],{"class":137},[10,625,627],{"id":626},"middleware","🔒 Middleware",[15,629,631],{"className":124,"code":630,"language":126,"meta":20,"style":20},"import { Injectable, NestMiddleware } from '@nestjs\u002Fcommon';\n\n@Injectable()\nexport class LoggerMiddleware implements NestMiddleware {\n  use(req, res, next) {\n    console.log('Request...');\n    next();\n  }\n}\n",[22,632,633,646,650,658,675,699,715,723,728],{"__ignoreMap":20},[25,634,635,637,640,642,644],{"class":27,"line":28},[25,636,134],{"class":133},[25,638,639],{"class":137}," { Injectable, NestMiddleware } ",[25,641,141],{"class":133},[25,643,144],{"class":35},[25,645,147],{"class":137},[25,647,648],{"class":27,"line":46},[25,649,153],{"emptyLinePlaceholder":152},[25,651,652,654,656],{"class":27,"line":58},[25,653,158],{"class":137},[25,655,414],{"class":31},[25,657,263],{"class":137},[25,659,660,662,664,667,670,673],{"class":27,"line":72},[25,661,189],{"class":133},[25,663,192],{"class":133},[25,665,666],{"class":31}," LoggerMiddleware",[25,668,669],{"class":133}," implements",[25,671,672],{"class":31}," NestMiddleware",[25,674,252],{"class":137},[25,676,677,680,682,685,688,691,693,696],{"class":27,"line":84},[25,678,679],{"class":31},"  use",[25,681,234],{"class":137},[25,683,684],{"class":318},"req",[25,686,687],{"class":137},", ",[25,689,690],{"class":318},"res",[25,692,687],{"class":137},[25,694,695],{"class":318},"next",[25,697,698],{"class":137},") {\n",[25,700,701,704,707,709,712],{"class":27,"line":96},[25,702,703],{"class":137},"    console.",[25,705,706],{"class":31},"log",[25,708,234],{"class":137},[25,710,711],{"class":35},"'Request...'",[25,713,714],{"class":137},");\n",[25,716,717,720],{"class":27,"line":104},[25,718,719],{"class":31},"    next",[25,721,722],{"class":137},"();\n",[25,724,725],{"class":27,"line":112},[25,726,727],{"class":137},"  }\n",[25,729,730],{"class":27,"line":298},[25,731,381],{"class":137},[10,733,735],{"id":734},"pipe","🧩 Pipe",[15,737,739],{"className":124,"code":738,"language":126,"meta":20,"style":20},"import { PipeTransform, Injectable } from '@nestjs\u002Fcommon';\n\n@Injectable()\nexport class ParseIntPipe implements PipeTransform {\n  transform(value: string) {\n    return parseInt(value, 10);\n  }\n}\n",[22,740,741,754,758,766,782,798,814,818],{"__ignoreMap":20},[25,742,743,745,748,750,752],{"class":27,"line":28},[25,744,134],{"class":133},[25,746,747],{"class":137}," { PipeTransform, Injectable } ",[25,749,141],{"class":133},[25,751,144],{"class":35},[25,753,147],{"class":137},[25,755,756],{"class":27,"line":46},[25,757,153],{"emptyLinePlaceholder":152},[25,759,760,762,764],{"class":27,"line":58},[25,761,158],{"class":137},[25,763,414],{"class":31},[25,765,263],{"class":137},[25,767,768,770,772,775,777,780],{"class":27,"line":72},[25,769,189],{"class":133},[25,771,192],{"class":133},[25,773,774],{"class":31}," ParseIntPipe",[25,776,669],{"class":133},[25,778,779],{"class":31}," PipeTransform",[25,781,252],{"class":137},[25,783,784,787,789,792,794,796],{"class":27,"line":84},[25,785,786],{"class":31},"  transform",[25,788,234],{"class":137},[25,790,791],{"class":318},"value",[25,793,322],{"class":133},[25,795,325],{"class":39},[25,797,698],{"class":137},[25,799,800,803,806,809,812],{"class":27,"line":96},[25,801,802],{"class":133},"    return",[25,804,805],{"class":31}," parseInt",[25,807,808],{"class":137},"(value, ",[25,810,811],{"class":39},"10",[25,813,714],{"class":137},[25,815,816],{"class":27,"line":104},[25,817,727],{"class":137},[25,819,820],{"class":27,"line":112},[25,821,381],{"class":137},[10,823,825],{"id":824},"exception-filter","🛑 Exception Filter",[15,827,829],{"className":124,"code":828,"language":126,"meta":20,"style":20},"import { ExceptionFilter, Catch, ArgumentsHost, HttpException } from '@nestjs\u002Fcommon';\n\n@Catch(HttpException)\nexport class HttpErrorFilter implements ExceptionFilter {\n  catch(exception: HttpException, host: ArgumentsHost) {\n    \u002F\u002F handle exception\n  }\n}\n",[22,830,831,844,848,858,874,901,906,910],{"__ignoreMap":20},[25,832,833,835,838,840,842],{"class":27,"line":28},[25,834,134],{"class":133},[25,836,837],{"class":137}," { ExceptionFilter, Catch, ArgumentsHost, HttpException } ",[25,839,141],{"class":133},[25,841,144],{"class":35},[25,843,147],{"class":137},[25,845,846],{"class":27,"line":46},[25,847,153],{"emptyLinePlaceholder":152},[25,849,850,852,855],{"class":27,"line":58},[25,851,158],{"class":137},[25,853,854],{"class":31},"Catch",[25,856,857],{"class":137},"(HttpException)\n",[25,859,860,862,864,867,869,872],{"class":27,"line":72},[25,861,189],{"class":133},[25,863,192],{"class":133},[25,865,866],{"class":31}," HttpErrorFilter",[25,868,669],{"class":133},[25,870,871],{"class":31}," ExceptionFilter",[25,873,252],{"class":137},[25,875,876,879,881,884,886,889,891,894,896,899],{"class":27,"line":84},[25,877,878],{"class":31},"  catch",[25,880,234],{"class":137},[25,882,883],{"class":318},"exception",[25,885,322],{"class":133},[25,887,888],{"class":31}," HttpException",[25,890,687],{"class":137},[25,892,893],{"class":318},"host",[25,895,322],{"class":133},[25,897,898],{"class":31}," ArgumentsHost",[25,900,698],{"class":137},[25,902,903],{"class":27,"line":96},[25,904,905],{"class":274},"    \u002F\u002F handle exception\n",[25,907,908],{"class":27,"line":104},[25,909,727],{"class":137},[25,911,912],{"class":27,"line":112},[25,913,381],{"class":137},[10,915,917],{"id":916},"lifecycle-hook","🏃 Lifecycle Hook",[15,919,921],{"className":124,"code":920,"language":126,"meta":20,"style":20},"import { OnModuleInit, Injectable } from '@nestjs\u002Fcommon';\n\n@Injectable()\nexport class AppService implements OnModuleInit {\n  onModuleInit() {\n    \u002F\u002F Called once module is initialized\n  }\n}\n",[22,922,923,936,940,948,964,972,977,981],{"__ignoreMap":20},[25,924,925,927,930,932,934],{"class":27,"line":28},[25,926,134],{"class":133},[25,928,929],{"class":137}," { OnModuleInit, Injectable } ",[25,931,141],{"class":133},[25,933,144],{"class":35},[25,935,147],{"class":137},[25,937,938],{"class":27,"line":46},[25,939,153],{"emptyLinePlaceholder":152},[25,941,942,944,946],{"class":27,"line":58},[25,943,158],{"class":137},[25,945,414],{"class":31},[25,947,263],{"class":137},[25,949,950,952,954,957,959,962],{"class":27,"line":72},[25,951,189],{"class":133},[25,953,192],{"class":133},[25,955,956],{"class":31}," AppService",[25,958,669],{"class":133},[25,960,961],{"class":31}," OnModuleInit",[25,963,252],{"class":137},[25,965,966,969],{"class":27,"line":84},[25,967,968],{"class":31},"  onModuleInit",[25,970,971],{"class":137},"() {\n",[25,973,974],{"class":27,"line":96},[25,975,976],{"class":274},"    \u002F\u002F Called once module is initialized\n",[25,978,979],{"class":27,"line":104},[25,980,727],{"class":137},[25,982,983],{"class":27,"line":112},[25,984,381],{"class":137},[10,986,988],{"id":987},"routing-params","🔗 Routing & Params",[15,990,992],{"className":124,"code":991,"language":126,"meta":20,"style":20},"@Get(':id')\nfindOne(@Param('id') id: string) { \u002F* ... *\u002F }\n\n@Post()\ncreate(@Body() dto: CreateUserDto) { \u002F* ... *\u002F }\n",[22,993,994,1006,1026,1030,1038],{"__ignoreMap":20},[25,995,996,998,1000,1002,1004],{"class":27,"line":28},[25,997,158],{"class":137},[25,999,260],{"class":31},[25,1001,234],{"class":137},[25,1003,293],{"class":35},[25,1005,240],{"class":137},[25,1007,1008,1011,1013,1015,1017,1019,1022,1024],{"class":27,"line":46},[25,1009,1010],{"class":31},"findOne",[25,1012,304],{"class":137},[25,1014,307],{"class":31},[25,1016,234],{"class":137},[25,1018,312],{"class":35},[25,1020,1021],{"class":137},") id: string) { ",[25,1023,275],{"class":274},[25,1025,278],{"class":137},[25,1027,1028],{"class":27,"line":58},[25,1029,153],{"emptyLinePlaceholder":152},[25,1031,1032,1034,1036],{"class":27,"line":72},[25,1033,158],{"class":137},[25,1035,345],{"class":31},[25,1037,263],{"class":137},[25,1039,1040,1043,1045,1047,1050,1052],{"class":27,"line":84},[25,1041,1042],{"class":31},"create",[25,1044,304],{"class":137},[25,1046,358],{"class":31},[25,1048,1049],{"class":137},"() dto: CreateUserDto) { ",[25,1051,275],{"class":274},[25,1053,278],{"class":137},[10,1055,1057],{"id":1056},"configuration","📦 Configuration",[15,1059,1061],{"className":124,"code":1060,"language":126,"meta":20,"style":20},"npm i @nestjs\u002Fconfig\n\n\u002F\u002F app.module.ts\nimport { ConfigModule } from '@nestjs\u002Fconfig';\n@Module({\n  imports: [ConfigModule.forRoot()],\n})\n",[22,1062,1063,1074,1078,1083,1097,1105,1116],{"__ignoreMap":20},[25,1064,1065,1068,1071],{"class":27,"line":28},[25,1066,1067],{"class":137},"npm i @nestjs",[25,1069,1070],{"class":133},"\u002F",[25,1072,1073],{"class":137},"config\n",[25,1075,1076],{"class":27,"line":46},[25,1077,153],{"emptyLinePlaceholder":152},[25,1079,1080],{"class":27,"line":58},[25,1081,1082],{"class":274},"\u002F\u002F app.module.ts\n",[25,1084,1085,1087,1090,1092,1095],{"class":27,"line":72},[25,1086,134],{"class":133},[25,1088,1089],{"class":137}," { ConfigModule } ",[25,1091,141],{"class":133},[25,1093,1094],{"class":35}," '@nestjs\u002Fconfig'",[25,1096,147],{"class":137},[25,1098,1099,1101,1103],{"class":27,"line":84},[25,1100,158],{"class":137},[25,1102,161],{"class":31},[25,1104,164],{"class":137},[25,1106,1107,1110,1113],{"class":27,"line":96},[25,1108,1109],{"class":137},"  imports: [ConfigModule.",[25,1111,1112],{"class":31},"forRoot",[25,1114,1115],{"class":137},"()],\n",[25,1117,1118],{"class":27,"line":104},[25,1119,184],{"class":137},[10,1121,1123],{"id":1122},"️-database-typeorm-example","🗃️ Database (TypeORM Example)",[15,1125,1127],{"className":124,"code":1126,"language":126,"meta":20,"style":20},"npm i @nestjs\u002Ftypeorm typeorm sqlite3\n\n\u002F\u002F app.module.ts\nimport { TypeOrmModule } from '@nestjs\u002Ftypeorm';\n@Module({\n  imports: [TypeOrmModule.forRoot()],\n})\n",[22,1128,1129,1138,1142,1146,1160,1168,1177],{"__ignoreMap":20},[25,1130,1131,1133,1135],{"class":27,"line":28},[25,1132,1067],{"class":137},[25,1134,1070],{"class":133},[25,1136,1137],{"class":137},"typeorm typeorm sqlite3\n",[25,1139,1140],{"class":27,"line":46},[25,1141,153],{"emptyLinePlaceholder":152},[25,1143,1144],{"class":27,"line":58},[25,1145,1082],{"class":274},[25,1147,1148,1150,1153,1155,1158],{"class":27,"line":72},[25,1149,134],{"class":133},[25,1151,1152],{"class":137}," { TypeOrmModule } ",[25,1154,141],{"class":133},[25,1156,1157],{"class":35}," '@nestjs\u002Ftypeorm'",[25,1159,147],{"class":137},[25,1161,1162,1164,1166],{"class":27,"line":84},[25,1163,158],{"class":137},[25,1165,161],{"class":31},[25,1167,164],{"class":137},[25,1169,1170,1173,1175],{"class":27,"line":96},[25,1171,1172],{"class":137},"  imports: [TypeOrmModule.",[25,1174,1112],{"class":31},[25,1176,1115],{"class":137},[25,1178,1179],{"class":27,"line":104},[25,1180,184],{"class":137},[10,1182,1184],{"id":1183},"testing","🧪 Testing",[15,1186,1188],{"className":124,"code":1187,"language":126,"meta":20,"style":20},"npm run test\nnpm\n",[22,1189,1190,1195],{"__ignoreMap":20},[25,1191,1192],{"class":27,"line":28},[25,1193,1194],{"class":137},"npm run test\n",[25,1196,1197],{"class":27,"line":46},[25,1198,1199],{"class":137},"npm\n",[1201,1202,1203],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":20,"searchDepth":46,"depth":46,"links":1205},[],"A comprehensive guide to NestJS framework.","md","material-icon-theme:nest",{},null,"\u002Fcheatsheets\u002Fnest","2025-08-14",{"title":5,"description":1206},{"loc":1211,"lastmod":1215},"2025-08-25T11:45:43+07:00","cheatsheets\u002Fnest","wrPGYteeXVvO7puvW2AkZMl-WksmNmzbYB84OJ81Dyw",[1219,1370,1474,1495],{"title":1220,"icon":1221,"path":1222,"stem":1223,"children":1224,"page":1235},"Posts","fluent-color:data-bar-vertical-ascending-24","\u002Fposts","posts",[1225,1236,1254,1280,1290,1304,1314,1324,1334,1360],{"title":1226,"icon":1227,"redirect":1228,"path":1229,"stem":1230,"children":1231,"page":1235},"Database","material-icon-theme:database","\u002Fposts\u002Fdatabase\u002Freplication-strategy","\u002Fposts\u002Fdatabase","posts\u002Fdatabase",[1232],{"title":1233,"path":1228,"stem":1234,"icon":1210},"Database Replication strategy in large systems","posts\u002Fdatabase\u002Freplication-strategy",false,{"title":1237,"icon":1238,"redirect":1239,"path":1240,"stem":1241,"children":1242,"page":1235},"Docker","vscode-icons:file-type-docker2","\u002Fposts\u002Fdocker\u002Fdocker-commands","\u002Fposts\u002Fdocker","posts\u002Fdocker",[1243,1246,1250],{"title":1244,"path":1239,"stem":1245,"icon":1210},"Docker commands essentials","posts\u002Fdocker\u002Fdocker-commands",{"title":1247,"path":1248,"stem":1249,"icon":1210},"Some useful Dockerfile templates","\u002Fposts\u002Fdocker\u002Fdockerfile-templates","posts\u002Fdocker\u002Fdockerfile-templates",{"title":1251,"path":1252,"stem":1253,"icon":1210},"Setup Docker environment on Windows","\u002Fposts\u002Fdocker\u002Fsetup-docker-on-window","posts\u002Fdocker\u002Fsetup-docker-on-window",{"title":1255,"icon":1256,"redirect":1257,"path":1258,"stem":1259,"children":1260,"page":1235},"Git & GitHub","material-icon-theme:git","\u002Fposts\u002Fgit\u002Fbrightly-decorate-graph","\u002Fposts\u002Fgit","posts\u002Fgit",[1261,1264,1268,1272,1276],{"title":1262,"path":1257,"stem":1263,"icon":1210},"Brightly decorate your GitHub Graph","posts\u002Fgit\u002Fbrightly-decorate-graph",{"title":1265,"path":1266,"stem":1267,"icon":1210},"Download a specific folder on GitHub repository","\u002Fposts\u002Fgit\u002Fdownload-specific-folder","posts\u002Fgit\u002Fdownload-specific-folder",{"title":1269,"path":1270,"stem":1271,"icon":1210},"Syncing Git Tags across to other repositories","\u002Fposts\u002Fgit\u002Fsyncing-tags-across-repositories","posts\u002Fgit\u002Fsyncing-tags-across-repositories",{"title":1273,"path":1274,"stem":1275,"icon":1210},"Unlocking GitHub Achievement badges","\u002Fposts\u002Fgit\u002Funlocking-achievement-badges","posts\u002Fgit\u002Funlocking-achievement-badges",{"title":1277,"path":1278,"stem":1279,"icon":1210},"Essential Git commands every developer should master","\u002Fposts\u002Fgit\u002Fuseful-commands-like-pro","posts\u002Fgit\u002Fuseful-commands-like-pro",{"title":1281,"icon":1282,"redirect":1283,"path":1284,"stem":1285,"children":1286,"page":1235},"Golang","material-icon-theme:go","\u002Fposts\u002Fgolang\u002Foptimizing-performance-with-pgo","\u002Fposts\u002Fgolang","posts\u002Fgolang",[1287],{"title":1288,"path":1283,"stem":1289,"icon":1210},"Optimizing Performance in Go Applications with PGO","posts\u002Fgolang\u002Foptimizing-performance-with-pgo",{"title":1291,"icon":1292,"redirect":1293,"path":1294,"stem":1295,"children":1296,"page":1235},"JavaScript","vscode-icons:file-type-js","\u002Fposts\u002Fjavascript\u002F9-lines-of-tips","\u002Fposts\u002Fjavascript","posts\u002Fjavascript",[1297,1300],{"title":1298,"path":1293,"stem":1299,"icon":1210},"9 lines of JavaScript replace 50 lines of code","posts\u002Fjavascript\u002F9-lines-of-tips",{"title":1301,"path":1302,"stem":1303,"icon":1210},"Javascript Promises - Specific functions and use cases","\u002Fposts\u002Fjavascript\u002Fpromises-cheatsheet","posts\u002Fjavascript\u002Fpromises-cheatsheet",{"title":1305,"icon":1306,"redirect":1307,"path":1308,"stem":1309,"children":1310,"page":1235},"Node","material-icon-theme:nodejs-alt","\u002Fposts\u002Fnodejs\u002Fevent-loop","\u002Fposts\u002Fnodejs","posts\u002Fnodejs",[1311],{"title":1312,"path":1307,"stem":1313,"icon":1210},"Secret about Event Loop flow in Nodejs","posts\u002Fnodejs\u002Fevent-loop",{"title":1315,"icon":1316,"redirect":1317,"path":1318,"stem":1319,"children":1320,"page":1235},"Nuxt","vscode-icons:file-type-nuxt","\u002Fposts\u002Fnuxt\u002Fenable-pwa-in-nuxt","\u002Fposts\u002Fnuxt","posts\u002Fnuxt",[1321],{"title":1322,"path":1317,"stem":1323,"icon":1210},"Enable PWA and Service Worker in Nuxt","posts\u002Fnuxt\u002Fenable-pwa-in-nuxt",{"title":1325,"icon":1326,"redirect":1327,"path":1328,"stem":1329,"children":1330,"page":1235},"Performance","emojione:rocket","\u002Fposts\u002Fperformance\u002Fbackground-image-injection-problem","\u002Fposts\u002Fperformance","posts\u002Fperformance",[1331],{"title":1332,"path":1327,"stem":1333,"icon":1210},"Background-Image injection problem in UX","posts\u002Fperformance\u002Fbackground-image-injection-problem",{"title":1335,"icon":1336,"redirect":1337,"path":1338,"stem":1339,"children":1340,"page":1235},"Tutorial","fluent-color:book-open-lightbulb-24","\u002Fposts\u002Ftutorial\u002Fclassification-and-functionality-of-the-servers","\u002Fposts\u002Ftutorial","posts\u002Ftutorial",[1341,1344,1348,1352,1356],{"title":1342,"path":1337,"stem":1343,"icon":1210},"Classification and functionality of the servers","posts\u002Ftutorial\u002Fclassification-and-functionality-of-the-servers",{"title":1345,"path":1346,"stem":1347,"icon":1210},"What is the difference between localhost and 127.0.0.1?","\u002Fposts\u002Ftutorial\u002Fdifferent-between-localhost-and-127-0-0-1","posts\u002Ftutorial\u002Fdifferent-between-localhost-and-127-0-0-1",{"title":1349,"path":1350,"stem":1351,"icon":1210},"8 essential network protocols every programmer should know","\u002Fposts\u002Ftutorial\u002Fessential-network-protocols","posts\u002Ftutorial\u002Fessential-network-protocols",{"title":1353,"path":1354,"stem":1355,"icon":1210},"Pre rels in header link tag - SEO technique enhancement","\u002Fposts\u002Ftutorial\u002Fpre-rels-in-header-link-tag","posts\u002Ftutorial\u002Fpre-rels-in-header-link-tag",{"title":1357,"path":1358,"stem":1359,"icon":1210},"Better code with SOLID principles","\u002Fposts\u002Ftutorial\u002Fwhat-is-solid","posts\u002Ftutorial\u002Fwhat-is-solid",{"title":1361,"icon":1362,"redirect":1363,"path":1364,"stem":1365,"children":1366,"page":1235},"UI\u002FUX","devicon:figma","\u002Fposts\u002Fuiux\u002Fcommon-button-mistake","\u002Fposts\u002Fuiux","posts\u002Fuiux",[1367],{"title":1368,"path":1363,"stem":1369,"icon":1210},"Common Button Mistake in UI\u002FUX","posts\u002Fuiux\u002Fcommon-button-mistake",{"title":1371,"icon":1372,"path":1373,"stem":1374,"children":1375,"page":1235},"Cheatsheets","fluent-color:paw-16","\u002Fcheatsheets","cheatsheets",[1376,1381,1386,1389,1394,1397,1402,1406,1411,1416,1421,1426,1427,1432,1436,1440,1445,1450,1454,1459,1464,1469],{"title":1377,"path":1378,"stem":1379,"icon":1380},"Bash","\u002Fcheatsheets\u002Fbash","cheatsheets\u002Fbash","material-icon-theme:powershell",{"title":1382,"path":1383,"stem":1384,"icon":1385},"CSS","\u002Fcheatsheets\u002Fcss","cheatsheets\u002Fcss","vscode-icons:file-type-css2",{"title":1237,"path":1387,"stem":1388,"icon":1238},"\u002Fcheatsheets\u002Fdocker","cheatsheets\u002Fdocker",{"title":1390,"path":1391,"stem":1392,"icon":1393},"Git","\u002Fcheatsheets\u002Fgit","cheatsheets\u002Fgit","devicon:git",{"title":1281,"path":1395,"stem":1396,"icon":1282},"\u002Fcheatsheets\u002Fgo","cheatsheets\u002Fgo",{"title":1398,"path":1399,"stem":1400,"icon":1401},"HTML","\u002Fcheatsheets\u002Fhtml","cheatsheets\u002Fhtml","material-icon-theme:html",{"title":1291,"path":1403,"stem":1404,"icon":1405},"\u002Fcheatsheets\u002Fjavascript","cheatsheets\u002Fjavascript","material-icon-theme:javascript",{"title":1407,"path":1408,"stem":1409,"icon":1410},"Latex","\u002Fcheatsheets\u002Flatex","cheatsheets\u002Flatex","material-icon-theme:latexmk",{"title":1412,"path":1413,"stem":1414,"icon":1415},"Linux","\u002Fcheatsheets\u002Flinux","cheatsheets\u002Flinux","devicon:linux",{"title":1417,"path":1418,"stem":1419,"icon":1420},"Markdown","\u002Fcheatsheets\u002Fmarkdown","cheatsheets\u002Fmarkdown","material-icon-theme:markdown",{"title":1422,"path":1423,"stem":1424,"icon":1425},"Mongo","\u002Fcheatsheets\u002Fmongo","cheatsheets\u002Fmongo","devicon:mongodb",{"title":5,"path":1211,"stem":1216,"icon":1208},{"title":1428,"path":1429,"stem":1430,"icon":1431},"Next","\u002Fcheatsheets\u002Fnext","cheatsheets\u002Fnext","logos:nextjs-icon",{"title":1305,"path":1433,"stem":1434,"icon":1435},"\u002Fcheatsheets\u002Fnode","cheatsheets\u002Fnode","material-icon-theme:nodejs",{"title":1315,"path":1437,"stem":1438,"icon":1439},"\u002Fcheatsheets\u002Fnuxt","cheatsheets\u002Fnuxt","material-icon-theme:nuxt",{"title":1441,"path":1442,"stem":1443,"icon":1444},"React","\u002Fcheatsheets\u002Freact","cheatsheets\u002Freact","material-icon-theme:react",{"title":1446,"path":1447,"stem":1448,"icon":1449},"Redis","\u002Fcheatsheets\u002Fredis","cheatsheets\u002Fredis","vscode-icons:folder-type-redis-opened",{"title":1451,"path":1452,"stem":1453,"icon":1227},"SQL","\u002Fcheatsheets\u002Fsql","cheatsheets\u002Fsql",{"title":1455,"path":1456,"stem":1457,"icon":1458},"Typescript","\u002Fcheatsheets\u002Ftypescript","cheatsheets\u002Ftypescript","material-icon-theme:typescript",{"title":1460,"path":1461,"stem":1462,"icon":1463},"Vercel","\u002Fcheatsheets\u002Fvercel","cheatsheets\u002Fvercel","vscode-icons:file-type-light-vercel",{"title":1465,"path":1466,"stem":1467,"icon":1468},"Vue","\u002Fcheatsheets\u002Fvue","cheatsheets\u002Fvue","material-icon-theme:vue",{"title":1470,"path":1471,"stem":1472,"icon":1473},"Windows","\u002Fcheatsheets\u002Fwindow","cheatsheets\u002Fwindow","material-icon-theme:folder-windows",{"title":1475,"icon":1476,"path":1477,"stem":1478,"children":1479,"page":1235},"Templates","fluent-color:data-pie-24","\u002Ftemplates","templates",[1480,1483,1486,1489,1492],{"title":1281,"path":1481,"stem":1482,"icon":1282},"\u002Ftemplates\u002Fgo","templates\u002Fgo",{"title":1428,"path":1484,"stem":1485,"icon":1431},"\u002Ftemplates\u002Fnext","templates\u002Fnext",{"title":1315,"path":1487,"stem":1488,"icon":1439},"\u002Ftemplates\u002Fnuxt","templates\u002Fnuxt",{"title":1441,"path":1490,"stem":1491,"icon":1444},"\u002Ftemplates\u002Freact","templates\u002Freact",{"title":1465,"path":1493,"stem":1494,"icon":1468},"\u002Ftemplates\u002Fvue","templates\u002Fvue",{"title":1496,"icon":1372,"path":1497,"stem":1498,"children":1499,"page":1235},"Interviews","\u002Finterviews","interviews",[1500],{"title":1398,"path":1501,"stem":1502,"icon":1401},"\u002Finterviews\u002Fhtml","interviews\u002Fhtml",[1504,1505],{"title":1422,"path":1423,"stem":1424,"children":-1},{"title":1428,"path":1429,"stem":1430,"children":-1}]