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

@bdadmin/nestjs

v1.0.5

Published

is a toolkit designed to simplify the creation of administrative dashboards. It provides a set of decorators and utilities for defining DTOs, entities, fields, authentication flows, and more, using metadata to efficiently create and manage complex admin i

Downloads

12

Readme

Backend-driven Admin - NestJS Module

@bdadmin/nestjs is a toolkit designed to simplify the creation of administrative dashboards. It provides a set of decorators and utilities for defining DTOs, entities, fields, authentication flows, and more, using metadata to efficiently create and manage complex admin interfaces.

Important: This package is part of the @bdadmin ecosystem

Features

  • Decorators: Easily annotate classes and properties with metadata for DTOs, entities, validation rules, login/logout/refresh handlers, and more.
  • Metadata Management: Utilizes reflect-metadata to store and retrieve configuration data.
  • Type Safety: Built with TypeScript to ensure type safety and improved developer experience.
  • CLI Support: Includes a CLI tool for scaffolding and managing BDAdmin components within your NestJS project.
  • Rollup Bundling: Packaged and optimized using Rollup, with TypeScript declaration support for seamless integration.

Installation

Install the package via npm:

npm install @bdadmin/nestjs

Peer Dependencies

Make sure to install and configure the following in your project:

  • reflect-metadata: Required for metadata reflection.
  • TypeScript: Ensure emitDecoratorMetadata and experimentalDecorators are enabled in your tsconfig.json.
{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    // ...other options
  }
}

Usage

Define the entities

import { BDAdminEntity, BDAdminBehavior } from '@bdadmin/nestjs';
import { Get } from "@nestjs/common";

@Controller("users")
@BDAdminEntity({ name: "users" })
export class UserController {
    @Get()
    @BDAdminBehavior({ 
        type: [UserController], 
        endpoint: { 
            url: "/users", 
            method: "GET"
        } 
    })
    findAll() { /* ... */ }

    @Post("/create")
    @BDAdminBehavior({
        type: UserCreateDto,
        endpoint: {
            url: "/users/create",
            method: "POST"
        }
    })
    create() { /* ... */ }
    
    // ...other methods
}

Configure fields & validation

import { BDAdminField, BDAdminValidation } from '@bdadmin/nestjs';

export class UserEntity {
    @BDAdminField({ type: 'string', sort: true, search: true })
    name: string;
  
    @BDAdminField({ type: 'number', sort: true })
    age: number;
    
    // ...other properties
}

export class UserCreateDto {
    @BDAdminValidation({
        type: 'string',
        unique: true,
        required: true
    })
    name: string;

    @BDAdminValidation({
        type: 'number',
        required: true,
        min: 16,
        max: 60
    })
    age: number;

    // ...other properties
}

Initialize authentication

import { BDAdminAuth, BDAdminLogin, BDAdminRefresh, BDAdminLogout } from '@bdadmin/nestjs';

@BDAdminAuth({
    accessKey: "access_token",
    refreshKey: "refresh_token"
})
export class AuthController {
    @Post("/login")
    @BDAdminLogin({
        endpoint: {
            url: "/login",
            method: "POST"
        },
        type: LoginDto
    })
    signIn() { /* ... */ }

    @Post("/refresh")
    @BDAdminRefresh({
        endpoint: {
            url: "/refresh",
            method: "POST"
        }
    })
    refresh() { /* ... */ }

    @Post("/logout")
    @BDAdminLogout({
        endpoint: {
            url: "/logout",
            method: "POST"
        }
    })
    logOut() { /* ... */ }
}

Running CLI

The package includes a CLI for scaffolding and management tasks. After installing globally or locally, you can invoke the CLI:

npx @bdadmin/nestjs [command] [options]

Use --help with the CLI to get a list of available commands and options:

npx @bdadmin/nestjs --help

Example

Generate a REST route with a config

npx @bdadmin/nestjs generate

Generate a local config

npx @bdadmin/nestjs generate --local

Generate a REST route with a config and a custom name

npx @bdadmin/nestjs generate --name config

Building from Source

If you are interested in building or modifying the package:

  1. Clone the repository:
git clone https://github.com/backend-driven-admin/bdadmin-nestjs
cd bdadmin-nestjs
  1. Install dependencies:
npm install
  1. Build the package:
npm run build

This will run Rollup to bundle the library, generate a CLI bundle, and create TypeScript declaration files.

Contributing

Contributions are welcome! Please open issues for any bugs or feature requests. Follow the repository guidelines for pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.