chenhang-nestjs
v1.0.0
Published
Reusable NestJS modules extracted from project-name.
Readme
project-name
Reusable NestJS modules extracted from project-name.
Install
npm install project-nameIf you publish this package under a scoped name, install that name instead:
npm install @your-npm-username/project-nameExports
import {
AuthModule,
PasswordModule,
PasswordService,
PrismaModule,
UsersModule,
} from 'project-name';The simplest module to test in another Nest project is PasswordModule.
import { Module } from '@nestjs/common';
import { PasswordModule } from 'project-name';
@Module({
imports: [PasswordModule],
})
export class AppModule {}AuthModule, UsersModule, and PrismaModule depend on the consuming app's configuration. The consuming app should provide ConfigModule.forRoot() and a valid DATABASE_URL environment variable before importing those modules.
Publish
Before publishing, change package.json name to a unique npm package name. A scoped package is easiest for practice:
{
"name": "@your-npm-username/project-name"
}Then run:
npm login
npm test
npm pack --dry-run
npm publish --access publicFor an unscoped package name, use:
npm publish