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

zync-nest-library

v1.0.38

Published

NestJS library with database backup and file upload utilities

Downloads

180

Readme

🚀 Zync NestJS Library

npm version License: ISC

A premium NestJS library suite designed for scalability and ease of integration. It provides enterprise-grade utilities for file management, payment gateways, messaging services, and advanced GraphQL support.


✨ Key Features

🛡️ Core Services

  • File Upload Service: Powerful file handling with automatic image resizing and multiple storage providers.
  • Bucket Service: Native integration with AWS S3 and DigitalOcean Spaces.
  • Firebase Service: Robust push notification management using FCM.
  • Mailer Service: Sophisticated email dispatch with customizable EJS templates.

💳 Payment Gateways

  • Senangpay: Malaysian payment gateway with FPX support.
  • Billplz: Seamless Malaysian payment integration.
  • Razorpay: Comprehensive Indian payment gateway support.

✉️ Messaging

  • Unified Message Service: A single interface to rule all channels (Email, SMS, WhatsApp, Push).
  • UltraMsg: Direct WhatsApp messaging via API.
  • Exabytes SMS: Reliable SMS gateway integration.

🛠️ Advanced Utilities

  • GraphQL Scalars: Custom types like ApStringOrArray.
  • GraphQL Directives: Depth limit protection to secure your API.
  • HTML Converter: Puppeteer-driven HTML to PDF/String conversion.
  • XLSX Service: Easy Excel generation and browser downloads.
  • Swagger Decorators: Instant Swagger UI support for file uploads.

📦 Installation

local Setup

# Clone and install
git clone https://github.com/zynctech/zync-nest-library.git
cd zync-nest-library
pnpm install

# Build the library
pnpm run build

Integration Methods

1. Direct File Link (Recommended for pnpm workspaces)

Add to your project's package.json:

{
  "dependencies": {
    "zync-nest-library": "file:../path/to/zync-nest-library"
  }
}

2. Local Linking

# In zync-nest-library
pnpm link --global

# In your project
pnpm link --global zync-nest-library

📚 Module Usage

Base Setup

Import the modules you need in your AppModule:

import { 
  UploadModule, 
  FirebaseModule, 
  MailerModule, 
  ApScalarModule,
  HtmlConverterModule 
} from 'zync-nest-library';

@Module({
  imports: [
    UploadModule,
    FirebaseModule,
    MailerModule,
    ApScalarModule,
    HtmlConverterModule,
    // ...
  ],
})
export class AppModule {}

🧬 GraphQL Scalars

The library includes ApStringOrArray and ApNumber to handle flexible input types in GraphQL.

import { ApStringOrArrayScalar, ApNumberScalar } from 'zync-nest-library';

// In your Resolver or DTO
@Field(() => ApStringOrArrayScalar)
tags: string | string[];

@Field(() => ApNumberScalar)
price: number;

📁 Upload Service

Handles local and cloud storage with automatic thumbnail generation.

@Injectable()
export class MyService {
  constructor(private readonly uploadService: UploadService) {}

  async handleUpload(file: Express.Multer.File) {
    return await this.uploadService.uploadFile({
      file: file.buffer,
      filename: file.originalname,
      filetype: file.mimetype,
      dir: 'profiles',
      transformName: true
    });
  }
}

🔒 Depth Limit Directive

Protect your GraphQL server from circular or overly complex queries.

// app.module.ts
GraphQLModule.forRoot({
  transformSchema: (schema) => deptLimitDirectiveTransformer(schema, 'deptLimit'),
})

// schema.graphql
type User {
  posts: [Post!]! @deptLimit(value: "5")
}

⚙️ Configuration

| Service | Environment Variables | | :--- | :--- | | AWS/S3 | aws_access_key_id, aws_secret_access_key, aws_s3_region, aws_bucket | | Mailer | MAILER_HOST, MAILER_USER, MAILER_PASS, MAILER_FROM, MAILER_PORT | | WhatsApp | ultramsg_instance, ultramsg_token, ultramsg_url | | SMS | exabytes_sms_username, exabytes_sms_password, exabytes_sms_url |

[!IMPORTANT] Firebase requires a serviceAccount.json file in your project root. Google API requires a credentials.json file in your project root.


🛠️ Development

Scripts

  • pnpm run build: Compile TypeScript files.
  • pnpm run build:watch: Development mode with auto-rebuild.
  • pnpm run clean: Remove dist and build artifacts.

Folder Structure

libs/src/
├── billplz/       # Billplz Gateway
├── decorators/    # Swagger File Decorators
├── directives/    # GraphQL Directives
├── exabytes/      # SMS Service
├── firebase/      # Push Notifications
├── googleapi/     # Google Drive Service
├── htmlConverter/ # PDF Generator
├── mailer/        # EJS Email Service
├── message/       # Unified Messenger
├── scalars/       # Custom GQL Scalars
├── senangpay/     # Senangpay Gateway
├── upload/        # Multi-provider Uploads
└── xlsx/          # Excel Exporter

🐛 Support

If you encounter issues, please open an issue in the GitHub Repository.

Developed with ❤️ by Zync Tech.