Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@automapper/nestjs

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automapper/nestjs

AutoMapper TypeScript NestJS integration

  • 8.8.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
decreased by-24.61%
Maintainers
1
Weekly downloads
 
Created
Source

@automapper/nestjs

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

Installation

npm i @automapper/nestjs

or with yarn:

yarn add @automapper/nestjs
peerDependencies

@automapper/nestjs depends on @automapper/core

npm i @automapper/core

or with yarn:

yarn add @automapper/core

Usage

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

// 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

Keywords

FAQs

Package last updated on 23 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc