# @ttshivers/automapper-nestjs

> AutoMapper TypeScript NestJS integration

Latest version **8.8.3** (published 2023-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ttshivers/automapper-nestjs
pnpm add @ttshivers/automapper-nestjs
yarn add @ttshivers/automapper-nestjs
bun add @ttshivers/automapper-nestjs
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 8.8.3 |
| Published | 2023-07-22 |
| First published | 2023-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 21.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1007 |
| Author | Chau Tran |
| Maintainers | ttshivers |
| Keywords | typescript, automapper, mapper, nx |

## Links

- npm: https://www.npmjs.com/package/@ttshivers/automapper-nestjs
- Repository: https://github.com/nartc/mapper.git#main
- Homepage: https://github.com/nartc/mapper/tree/main#readme
- Issues: https://github.com/nartc/mapper/issues
- npm.io page: https://npm.io/package/@ttshivers/automapper-nestjs

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 8.8.3 (latest) — 2023-07-22
- 8.8.1 — 2023-07-21
- 8.8.0 — 2023-07-08
- 0.0.0 — 2023-07-08

## README

# @ttshivers/automapper-nestjs

This is a NestJS module to integrate `@automapper` with NestJS.

## Installation

```sh
npm i @ttshivers/automapper-nestjs
```

or with `yarn`:

```sh
yarn add @ttshivers/automapper-nestjs
```

#### `peerDependencies`

`@ttshivers/automapper-nestjs` depends on `@ttshivers/automapper-core`

```sh
npm i @ttshivers/automapper-core
```

or with `yarn`:

```sh
yarn add @ttshivers/automapper-core
```

## Usage

Call `AutomapperModule.forRoot()` and provide some options to initialize the `Mapper` object(s).

```ts
// Single Mapper
@Module({
    imports: [
        AutomapperModule.forRoot({
            strategyInitializer: classes(),
        }),
    ],
})
export class AppModule {}

// Multiple Mappers
@Module({
    imports: [
        AutomapperModule.forRoot(
            [
                {
                    name: 'classes',
                    strategyInitializer: classes(),
                },
                {
                    name: 'pojos',
                    strategyInitializer: pojos(),
                },
            ],
            {
                /*  globalErrorHandler: ErrorHandler */
                /*  globalNamingConventions: NamingConvention | {source, destination} */
            }
        ),
    ],
})
export class AppModule {}
```

`AutomapperModule` is a `Global` module so when `Mapper` object(s) are initialized, they're available across the application.

Read more about this on the [documentation site](https://automapperts.netlify.app/docs/nestjs)

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