npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

armert-dto-for-nestjs

v1.0.1

Published

Reusable, framework-agnostic DTO package with validation rules for NestJS and TypeScript-based backend applications.

Readme

Armert NestJS DTO Package 🚀

🇹🇷 TANRI TÜRK'Ü KORUSUN VE YÜCELTSİN 🐺

NPM Version License Downloads TypeScript NestJS


📖 Overview

Armert DTO is an enterprise-grade, strict, and modular Data Transfer Object (DTO) library designed specifically for scalable NestJS applications. It abstracts standard e-commerce patterns into reusable, validated, and type-safe classes, ensuring your backend is robust from day one.

Unlike simple DTO collections, this package implements Domain-Driven Design (DDD) principles, strictly validating business rules at the transport layer (e.g., verifying that a product cannot have both 'Limited Stock' type and 'Unlimited' quantity simultaneously).

✨ Key Features

  • 🛡️ Strict Type Safety: Full TypeScript support with class-validator integration.
  • 🧠 Domain Logic Validation: Custom decorators to validate complex business rules cross-fields.
  • 🌍 Internationalization Ready: Built-in LocalizedTextDTO for multi-language support.
  • 🏗️ Modular Architecture: Decoupled modules for Auth, Product, Order, Cart, and Payment.
  • 🚀 Production Ready: Includes standard Pagination, API Response, and Base Entity structures.

📦 Installation

Install the package alongside its peer dependencies:

npm install armert-dto-for-nestjs class-validator class-transformer @nestjs/mapped-types @nestjs/swagger

🛠️ Usage Guide

1. Authentication & User Management

Streamline your auth controller with pre-validated DTOs.

import { Body, Controller, Post } from '@nestjs/common';
import { LoginDTO, AuthResponseDTO } from 'armert-dto-for-nestjs';

@Controller('auth')
export class AuthController {
  @Post('login')
  async login(@Body() payload: LoginDTO): Promise<AuthResponseDTO> {
    // payload.email -> validated as email
    // payload.password -> validated for complexity
    return this.authService.validateUser(payload);
  }
}

2. Advanced Product Validation

The package prevents invalid states before they reach your business logic.

import { CreateProductDTO, StockType } from 'armert-dto-for-nestjs';

const product = new CreateProductDTO();

// ❌ Error: Discount price cannot be higher than the regular price.
product.price = 100;
product.discountPrice = 150; 

// ❌ Error: Stocks cannot be defined if the product creates explicit variants.
product.variants = [{ sku: 'V1', price: 10, stock: 5 }];
product.stock = 100;

// ✅ Success: Valid product structure
product.stockType = StockType.LIMITED;
product.stock = 50; 

3. Order & Checkout Flow

Standardize your order processing with rigid Enums and nested object validation.

import { CreateOrderDTO, PaymentMethod } from 'armert-dto-for-nestjs';

// Automatically validates addresses UUIDs and Payment Method enums
const orderData: CreateOrderDTO = {
  shippingAddressId: 'uuid-1',
  billingAddressId: 'uuid-2',
  paymentMethod: PaymentMethod.CREDIT_CARD,
  items: [...]
};

4. Pagination & filtering

Easily implement standardized pagination in your controllers.

// Controller
import { PaginationQueryDTO, PaginatedResponseDTO } from 'armert-dto-for-nestjs';

@Get()
async getAll(@Query() query: PaginationQueryDTO): Promise<PaginatedResponseDTO<UserDTO>> {
   // query.page, query.limit, query.sortBy are automatically parsed & validated.
   return this.userService.findAll(query);
}

📂 Module Structure

| Module | Description | | :--- | :--- | | Common | PaginatedResponse, ApiError, BaseEntity | | User | Auth, Profile, Role Management | | Product | SEO, Variants, Attributes, Stock Logic | | Order | Checkout, Status Workflow, Shipment | | Cart | Basket Operations, Coupons | | Review | Ratings, Comments, Moderation | | Payment | Provider Integration, 3D Secure Handling |

🤝 Contribution & Development

We love contributions! This project is open for any kind of improvement. Whether you want to add new DTOs, improve validation logic, or fix bugs, your help is welcome.

How to contribute:

  1. Fork the repository.
  2. Clone your fork to your local machine:
    git clone https://github.com/MertcanMert/armert-dto-for-nestjs.git
  3. Create a new branch for your feature or fix:
    git checkout -b feature/amazing-feature
  4. Make your changes and commit them:
    git commit -m 'feat: Add amazing feature'
  5. Push to your branch:
    git push origin feature/amazing-feature
  6. Open a Pull Request against the main branch.

Suggestions?

If you have an idea but don't know how to implement it, feel free to open a Discussion or an Issue. We are actively looking for feedback to make this the standard DTO library for NestJS e-commerce projects.

📝 License

Distributed under the ISC License. See LICENSE for more information.