๐Ÿš€ DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more โ†’
Socket
Book a DemoInstallSign in
Socket

dude-wa-sticker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dude-wa-sticker

Pembuat dan pemformat stiker untuk WhatsApp

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

DUDE STICKER - WhatsApp Sticker Generator Library

Banner

npm version Downloads

A lightweight, high-performance JavaScript library for creating WhatsApp stickers with rich metadata support. Convert images, GIFs, and videos to WhatsApp-compatible WebP stickers with ease.

Key Features โœจ

  • ๐Ÿš€ Pure JavaScript implementation (No TypeScript build required)
  • ๐Ÿ”ฅ Supports all WhatsApp sticker metadata (pack, author, categories)
  • ๐Ÿ“ Multiple input formats: Buffer, URL, SVG, file path
  • ๐ŸŽจ Advanced styling options (crop, full, circle, rounded, star)
  • ๐ŸŒˆ Custom background colors (hex or RGBA)
  • โšก Optimized performance for server environments
  • ๐Ÿ”„ GIF/Video to animated WebP conversion
  • ๐Ÿ“ฆ Built-in methods for Baileys-MD compatibility

Installation ๐Ÿ’ป

npm install dude-wa-sticker
# or
yarn add dude-wa-sticker

Quick Start ๐Ÿš€

Basic Usage

import { Sticker, StickerTypes } from 'dude-wa-sticker';

// Create sticker from image URL
const sticker = new Sticker('https://example.com/image.jpg', {
  pack: 'Awesome Pack', 
  author: 'Sticker Creator',
  type: StickerTypes.FULL,
  categories: ['๐Ÿ˜‚', 'โค๏ธ'],
  quality: 90,
  background: '#ffffff'
});

// Save to file
await sticker.toFile('sticker.webp');

// Get as Buffer
const buffer = await sticker.toBuffer();

// Send via Baileys
conn.sendMessage(jid, await sticker.toMessage());

Advanced Usage

// Method chaining example
const sticker = await new Sticker('local/image.png')
  .setPack('Travel Pack')
  .setAuthor('Wanderlust')
  .setCategories(['โœˆ๏ธ', '๐ŸŒ'])
  .setBackground('#00a8ff')
  .setQuality(80)
  .toBuffer();

// SVG Sticker
const svgSticker = new Sticker(`
  <svg width="512" height="512" viewBox="0 0 512 512">
    <circle cx="256" cy="256" r="200" fill="#ff5722"/>
  </svg>
`, {
  author: 'SVG Artist'
});

API Reference ๐Ÿ“š

Sticker Class

Constructor

new Sticker(source: Buffer | string, options?: StickerOptions)

Methods

MethodDescriptionReturns
.toBuffer()Converts sticker to BufferPromise<Buffer>
.toFile(path: string)Saves sticker to filePromise<void>
.toMessage()Formats for Baileys-MDPromise<Message>
.setPack(pack: string)Sets sticker pack namethis
.setAuthor(author: string)Sets author namethis
.setType(type: StickerTypes)Sets sticker typethis
.setCategories(categories: string[])Sets sticker categories (emojis)this
.setQuality(quality: number)Sets output quality (0-100)this
.setBackground(background: Color)Sets background colorthis

StickerOptions

OptionTypeDefaultDescription
packstringundefinedSticker pack name
authorstringundefinedAuthor name
typeStickerTypesDEFAULTSticker style type
categoriesstring[][]Sticker categories (emojis)
qualitynumber100Output quality (0-100)
backgroundColortransparentBackground color

StickerTypes Enum

enum StickerTypes {
  DEFAULT = 'default',
  CROPPED = 'crop',
  FULL = 'full',
  CIRCLE = 'circle',
  ROUNDED = 'rounded',
  STAR = 'star'
}

Examples ๐ŸŽจ

Creating Different Sticker Types

// Cropped sticker
const cropped = new Sticker(image, { 
  type: StickerTypes.CROPPED 
});

// Circle sticker
const circle = new Sticker(image, {
  type: StickerTypes.CIRCLE,
  background: '#ffffff'
});

// Animated sticker from GIF
const animated = new Sticker('animation.gif', {
  pack: 'Animations',
  quality: 80
});

Extracting Metadata

import { extractMetadata } from 'dude-wa-sticker';

const metadata = await extractMetadata(stickerBuffer);
/*
{
  emojis: ['๐Ÿ˜‚'],
  'sticker-pack-id': '12345',
  'sticker-pack-name': 'Funny Pack',
  'sticker-author-name': 'MyPice'
}
*/

Best Practices โœ…

  • Quality Settings: For optimal results:

    • Static images: 90-100 quality
    • Animated stickers: 70-80 quality (better filesize)
  • Background Colors:

    • Use transparent (undefined) for cut-out stickers
    • Use solid colors for full-size stickers
  • Performance Tips:

    • Reuse Sticker instances when possible
    • For batch processing, consider using worker threads

Contributing ๐Ÿค

We welcome contributions! Please read our Contribution Guidelines before submitting pull requests.

License ๐Ÿ“„

This project is licensed under the GPL-3.0.

Made with โค๏ธ by [HELVIO & REYHAN] | GitHub | npm

Keywords

whatsapp

FAQs

Package last updated on 29 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts