- Clone the template
- Run npm/yarn install
cd nestjs-package-starter
npm installThis main folder will contain both package and a small test-app to test the package.
mkdir nestjs-packageClone the template inside the nestjs-package folder
cd nestjs-package
git clone https://github.com/sagarv1997/nestjs-package-templatecd nestjs-package-template
npm install
npm buildNow create a small NestJS app inside the nestjs-package folder to test the package functionality.
cd ..
nest new test-appcd test-app
npm install ../nestjs-package-templateUse 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.