# @nestjs-package-publishing/nestjs-app

> nestjs-app

Latest version **1.0.7** (published 2021-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nestjs-package-publishing/nestjs-app
pnpm add @nestjs-package-publishing/nestjs-app
yarn add @nestjs-package-publishing/nestjs-app
bun add @nestjs-package-publishing/nestjs-app
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-01-21 |
| First published | 2021-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | @ |
| Maintainers | sebascastillocortez |

## Links

- npm: https://www.npmjs.com/package/@nestjs-package-publishing/nestjs-app
- npm.io page: https://npm.io/package/@nestjs-package-publishing/nestjs-app

## Dependencies (6)

- [rxjs](https://npm.io/package/rxjs.md) ^6.6.3
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [@nestjs/core](https://npm.io/package/@nestjs/core.md) ^7.5.1
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) ^7.5.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@nestjs/platform-express](https://npm.io/package/@nestjs/platform-express.md) ^7.5.1

## Recent versions

- 1.0.7 (latest) — 2021-01-21
- 1.0.6 — 2021-01-21
- 1.0.5 — 2021-01-20

## README

<div align="center">
  <a href="http://nestjs.com/" target="_blank">
    <img src="https://nestjs.com/img/logo_text.svg" width="150" alt="Nest Logo" />
  </a>
</div>
<h2 align="center">nestjs-package-publishing</h2>
<div align="center">
  <a href="https://nestjs.com" target="_blank">
    <img src="https://img.shields.io/badge/built%20with-NestJS-red.svg" alt="Built with NestJS">
  </a>
</div>

## Installation

```bash
$ npm i @nestjs-package-publishing/nestjs-app
```

## Import Module

```typescript
import { Module } from '@nestjs/common';
import { ExampleModule } from '@nestjs-package-publishing/nestjs-app';
...

@Module({
  imports: [..., ExampleModule.register({ message: 'hello' })],
  ...
})
export class AppModule {}
```

The `register()` method requires the configuration properties:

| Property | Description       | Type   | Example |
| -------- | ----------------- | ------ | ------- |
| message  | message to return | string | hello   |

## Async configuration

You may want to pass your repository module options asynchronously instead of statically. In this case, use the `registerAsync()` method, which provides several ways to deal with async configuration.

```typescript
import { Module } from '@nestjs/common';
import { ExampleModule } from '@nestjs-package-publishing/nestjs-app';
...

@Module({
  imports: [..., ExampleModule.registerAsync(
    {
      useFactory: (configService: ConfigService) => ({
        message: configService.get('MESSAGE')
      }),
      inject: [ConfigService],
    }
  )],
  ...
})
export class AppModule {}
```

## Import provider only

```typescript
import { Module } from '@nestjs/common';
import { AppService } from './app.service';
import { ExampleService, ExampleController } from '@nestjs-package-publishing/nestjs-app';

@Module({
  providers: [
    ...,
    {
      provide: 'EXAMPLE_MODULE_OPTIONS',
      useValue: { message: 'hello' },
    },
    ExampleService,
  ],
  controllers: [..., ExampleController]
  ...
})
export class AppModule {}
```

## Use service

```typescript
import { Injectable } from '@nestjs/common';
import { ExampleService } from '@nestjs-package-publishing/nestjs-app';

@Injectable()
export class AppService {

  constructor(private readonly exampleService: ExampleService){}

  example(): string {
    return this.exampleService.greeting();
  }
  ...
}
```

## License

Nest is [MIT licensed](LICENSE).

---
_Source: https://npm.io/package/@nestjs-package-publishing/nestjs-app · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
