- Clone the template
- Run npm/yarn install
cd nestjs-package-starter
npm install
This main folder will contain both package and a small test-app to test the package.
mkdir nestjs-package
Clone the template inside the nestjs-package folder
cd nestjs-package
git clone https://github.com/sagarv1997/nestjs-package-template
cd nestjs-package-template
npm install
npm build
Now create a small NestJS app inside the nestjs-package folder to test the package functionality.
cd ..
nest new test-app
cd test-app
npm install ../nestjs-package-template
Use any of the functions from the package in your test-app. Don't forget to import the Module and Service in the main app module.
While developing any package or library, there might be cases where you would require functionality from @nestjs/* like @nestjs/common, during such cases, instead of adding the package in dependencies, add them in peerDependencies.
Add them in dependencies might lead to some unexpected behaviour in the root project.
Licensed under the MIT License - see the LICENSE file for details.