# @radrat-nest/bootstrap

> ## Features

Latest version **0.0.14** (published 2022-04-25) · 0 weekly downloads

## Install

```sh
npm install @radrat-nest/bootstrap
pnpm add @radrat-nest/bootstrap
yarn add @radrat-nest/bootstrap
bun add @radrat-nest/bootstrap
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2022-04-25 |
| First published | 2021-03-24 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 87 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | radarsu |

## Links

- npm: https://www.npmjs.com/package/@radrat-nest/bootstrap
- npm.io page: https://npm.io/package/@radrat-nest/bootstrap

## Dependencies (10)

- [csurf](https://npm.io/package/csurf.md) ^1.11.0
- [helmet](https://npm.io/package/helmet.md) ^4.6.0
- [winston](https://npm.io/package/winston.md) ^3.3.3
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.6
- [class-validator](https://npm.io/package/class-validator.md) ^0.13.2
- [options-defaults](https://npm.io/package/options-defaults.md) ^2.0.39
- [class-transformer](https://npm.io/package/class-transformer.md) ^0.5.1
- [express-rate-limit](https://npm.io/package/express-rate-limit.md) ^5.5.1
- [@radrat-nest/logger](https://npm.io/package/@radrat-nest/logger.md) ^0.0.8
- [@radrat-node/unified-config](https://npm.io/package/@radrat-node/unified-config.md) 0.0.3

## Recent versions

- 0.0.14 (latest) — 2022-04-25
- 0.0.13 — 2022-02-14
- 0.0.12 — 2021-12-20
- 0.0.11 — 2021-12-15
- 0.0.9 — 2021-04-29
- 0.0.8 — 2021-04-28
- 0.0.7 — 2021-04-15
- 0.0.6 — 2021-04-02
- 0.0.5 — 2021-04-02
- 0.0.4 — 2021-03-24

## README

# @radrat-nest/bootstrap

## Features

-   **Auto-configuration of common packages** - @radrat-nest/logger, class-transformer, class-validator, cookie-parser, csurf, express-rate-limit, helmet, winston. It fixes https://docs.nestjs.com/recipes/prisma#issues-with-enableshutdownhooks if it detects @radrat-nest/prisma library. You just need to install them and @radrat-nest/bootstrap will detect and integrate them into app with reasonable defaults.
-   **Unified configuration** - loads and validates configuration from dotenv and CLI in unified format and exposes that in staticConfig variable. CLI arguments override `.env` variables.
-   **Fully customizable** - via hooks, middleware and providers you can turn off or replace with custom almost any behavior.

## Usage

### Bootstrapping application

`./src/main.ts`

```ts
import { Config, validationSchema, staticConfig } from './config.schema';

import { AppModule } from './app/app.module';
import { bootstrap } from '@radrat-nest/bootstrap';

void bootstrap<Config>({
    module: AppModule,
    bootstrap: {
        staticConfig,
    },
    joiValidation: {
        schema: validationSchema,
    },
}).catch((err: Error) => {
    console.error(err);
    process.exit(1);
});
```

### Accessing global configuration

```ts
import { staticConfig } from './config.schema';

const { config } = staticConfig;
```

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