{"library":"nest-router","title":"Nest Router Module","description":"nest-router is a module for the NestJS framework designed to provide a hierarchical and modular approach to route organization. It allows developers to define a tree-like structure for application routes, automatically prefixing controller paths based on parent module configurations. For example, a child module's routes will inherit the parent's prefix, resulting in `/parent/child/route` rather than just `/child/route`. This addresses a common routing organization challenge in older NestJS versions (specifically prior to features like `APP_BASE_URL` or later routing enhancements). The last stable version is 1.0.9, published 7 years ago. This package is largely incompatible with modern NestJS versions (v6+ and especially v10+, with NestJS 11.1.19 being the latest as of April 2026). Its primary differentiator was its ability to structure routes in a more organized, tree-like manner for NestJS applications relying on a specific routing pattern.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install nest-router"],"cli":null},"imports":["import { RouterModule } from 'nest-router';","import { Routes } from 'nest-router';","RouterModule.forRoutes(routes);","RouterModule.resolvePath(SomeController);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { Module } from '@nestjs/common';\nimport { RouterModule, Routes } from 'nest-router';\n\n// Imagine these are actual NestJS modules with controllers\nclass CatsModule {}\nclass DogsModule {}\nclass NinjaModule {}\n\nconst routes: Routes = [\n  {\n    path: '/ninja',\n    module: NinjaModule,\n    children: [\n      {\n        path: '/cats',\n        module: CatsModule,\n      },\n      {\n        path: '/dogs',\n        module: DogsModule,\n      },\n    ],\n  },\n];\n\n@Module({\n  imports: [\n    RouterModule.forRoutes(routes), // Set up the routes hierarchy\n    CatsModule,\n    DogsModule,\n    NinjaModule // All modules must also be imported normally\n  ],\n})\nexport class ApplicationModule {}\n\n// Example of how a controller path would resolve:\n// A controller in CatsModule with @Controller('my-cat')\n// would have a full path of /ninja/cats/my-cat\n","lang":"typescript","description":"This quickstart demonstrates how to define a hierarchical route structure using `nest-router` and integrate it into a NestJS application. It shows how parent modules define prefixes for their children's routes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}