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

notif-sender-nestjs

v0.2.6

Published

A NestJS module for sending notifications via Email and Telegram.

Readme

🔔 Notif-Sender NestJS

Notif-Sender-NestJS is a notification service built for NestJS applications. It provides an easy way to send notifications via Email and Telegram, with built-in queue management using RxJS for better scalability.

Features

  • ✅ Send Email notifications using SMTP
  • ✅ Send Telegram messages to a bot
  • ✅ Built-in queue management using RxJS
  • ✅ Designed for scalability and easy integration into NestJS projects
  • ✅ Limit the maximum number of concurrent requests for sending notifications

Queue Management with RxJS

Notif-Sender uses RxJS to queue and manage notifications, ensuring that messages are sent efficiently without blocking the main thread. This is useful for handling large volumes of notifications.

🪴 Usage

This example demonstrates how to use notif-sender-nestjs for sending emails in a NestJS application.

📥 Installation

Make sure you have installed the required package:

npm install notif-sender-nestjs

Or if you use pnpm:

pnpm add notif-sender-nestjs

🧑‍💻 Configuration

Import NotifSenderModule in your module and configure it as follows:

import { NotifSenderModule } from 'notif-sender-nestjs'

@Module({
    imports: [
        NotifSenderModule.register({
            emailSenderConfig: {
                enable: boolean,
                host: 'string',
                port: number,
                secure: boolean,
                auth: {
                    user: 'string',
                    pass: '******',
                },
                default: {
                    from: 'string', // optional
                },
                maxConcurrentRequests: number // default is 2
            },
            telegramSenderConfig: {
                enable: boolean,
                botToken: 'string',
                chatId: 'string',
                maxConcurrentRequests: number // default is 2
            },
            logging: {
                enable: true // default is true!
            }
        }),
    ],
    controllers: [ AppController ],
    providers: [ AppService ],
})
export class AppModule {}

💎 Usage in Service

This service provides four methods for sending notifications via Telegram or email:

📧 Email :

💥 sendNotifToEmail : Sends an email immediately. Use this when you need to ensure the email is sent before continuing execution.

🗃️ sendNotifToEmail_addToQueue : Queues the email for later sending. This is useful when you don't need an immediate response and just want the email to be processed asynchronously.

📨 Telegram :

💥 sendNotifToTelegram : The sendNotifToTelegram method sends notifications directly to the chat ID configured during setup. However, you can also specify a different chat ID when calling this method.

⚠️ Important: Before sending a notification, the user must have already started a conversation with the bot; otherwise, the bot won't be able to send messages

⚠️ To send a message in a group or channel, the bot must be an admin!

🗃️ sendNotifToTelegram_addToQueue : This method works similarly to sendNotifToTelegram, but instead of sending the notification immediately, it adds it to a queue and sends it in order

Inject NotifSenderService into your service and send an email as follows:

import { NotifSenderService } from 'notif-sender-nestjs'

@Injectable()
export class AppService {
    constructor(private readonly notifService: NotifSenderService) {}

    async getHello()
    {
        // Send to email
        await this.notifService.sendNotifToEmail({
            subject: 'Hello',
            text: 'Hello World!',
            to: '[email protected]',
            html: '<p>Hello World!</p>',
            from: 'Abolfazl Ghaderi <abolfazlghaderi.ir>' // Optional - higher priority
        })

        // Send to telegram
        await this.notifService.sendNotifToTelegram({
            text: 'Hi mr.Brian',
            chatId: 'string', // Optional - higher priority
        })

        return 'Hello World!'
    }

    // OR

    getHello()
    {
        // Send to email
        this.notifService.sendNotifToEmail_addToQueue({
            subject: 'Hello',
            text: 'Hello World!',
            to: '[email protected]',
            html: '<p>Hello World!</p>',
            from: 'Abolfazl Ghaderi <abolfazlghaderi.ir>' // Optional - higher priority
        })

        // Send to telegram
        this.notifService.sendNotifToTelegram_addToQueue({
            text: 'Hi mr.Brian',
            chatId: 'string', // Optional - higher priority
        })

        return 'Hello World!'
    } 
}

🚀 Feedback & Contact

Got any questions or suggestions? Feel free to reach out ❤️

🌐 Website: abolfazlghaderi.ir
📩 Email: [email protected]
💬 Telegram: @Abolfazl_ghaderii

Let's build something amazing together! ✨