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

nestjs-direct-send

v0.1.1

Published

다이렉트 샌드 메일 발송 nestjs 라이브러리 입니다

Readme

nestjs-direct-send

  • 다이렉트 샌드 이메일/문자 발송, 잔액 조회 기능을 모듈화한 nestjs 라이브러리 입니다.
  • 개인적으로 사용하려고 모듈화 한 것이기 때문에 빠져있는 기능들이 많습니다.
  • 다이렉트샌드 api에 대한 자세한 내용은 아래 링크에서 확인 가능합니다. https://directsend.co.kr/index.php/customer/manual

INSTALL

$ npm install nestjs-direct-send

1. EXAMPLE

1-1. module.ts

import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { DirectSendModule } from 'nestjs-direct-send';

@Module({
  imports: [
    // DirectSendModule 등록
    DirectSendModule.register({
      username: 'DirectSend 발급 ID',
      key: 'DirectSend 발급 API KEY',
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

1-2. service.ts

// 사용할 Service에 주입 후 사용

import { Injectable } from '@nestjs/common';
import { DirectSendService } from 'nestjs-direct-send';

@Injectable()
export class AppService {
  constructor(private readonly directSendService: DirectSendService) {}
  async sendEmail(data: SEND_EMAIL_PARAMS): Promise<RESPONSE_TYPE> {
    const response = await this.directSendService.sendEmail(data);
    return response;
  }

  async sendSMS(data: DIRECT_SEND_SMS_REQUEST_TYPE): Promise<RESPONSE_TYPE> {
    const response = await this.directSendService.sendSMS(data);
    return response;
  }

  async getRemainingMoney(): Promise<number> {
    const response = await this.directSendService.getRemainingMoney();
    return response;
  }
}

1-3. METHOD

sendEmail(data: SEND_EMAIL_PARAMS): Promise<RESPONSE_TYPE<string>>

sendSMS(data: DIRECT_SEND_SMS_REQUEST_TYPE): Promise<RESPONSE_TYPE<string>>

getRemainingMoney(): Promise<RESPONSE_TYPE<number | string>>

1-4. SEND_EMAIL_PARAMS, DIRECT_SEND_SMS_REQUEST_TYPE, RESPONSE_TYPE

type SEND_EMAIL_PARAMS = {
  subject: string; // 메일 제목
  receiver: { email: string; name?: string; mobile?: string; note1?: string; note2?: string }[]; // 메일 수신자 리스트
  body: string; // 메일 내용 (html)
  sender: string; // 메일 발신자 이메일
  sender_name?: string; // 메일 발신자 이름
};

type DIRECT_SEND_SMS_REQUEST_TYPE = {
  title?: string; // 문자 제목
  message: string; // 문자 내용
  sender: string; // 문자 발송자 번호
  receiver: { mobile: string; name?: string; note1?: string; note2?: string }[]; // 문자 수신자 리스트
  sms_type: string; // 발송 타입 (현재 NORMAL만 구현)
};

type RESPONSE_TYPE<T> = {
  message: string; // 'success OR fail'
  statusCode: number; // 200 OR 400
  data: T; // <T>
};

1-5. API 리턴 타입

// 성공 시
response = { message: 'success', statusCode: 200, data: '0' };
// 실패 시
response = { message: 'fail', statusCode: 400, data: '에러 메세지' };