@monowork-shared/nestjs-package-template
v1.0.9
Published
NestJS npm package template
Downloads
3
Readme
Installation
- Clone the template
- Run npm/yarn install
cd nestjs-package-starter
npm install
Testing
1. Setup a main folder
This main folder will contain both package and a small test-app to test the package.
mkdir nestjs-package
2. Clone the Template
Clone the template inside the nestjs-package folder
cd nestjs-package
git clone https://github.com/sagarv1997/nestjs-package-template
3. Install package dependencies and build
cd nestjs-package-template
npm install
npm build
4. Scaffold a small NestJS App
Now create a small NestJS app inside the nestjs-package folder to test the package functionality.
cd ..
nest new test-app
5. Install the package
cd test-app
npm install ../nestjs-package-template
6. Test package functions
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.
Note
@nestjs/* not in dependencies ⚠️
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.
Reads
Author
License
Licensed under the MIT License - see the LICENSE file for details.