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

stickers-formatter

v0.0.1

Published

Sticker Creator for WhatsApp

Readme

Stickers-Formatter

Create and format WhatsApp Stickers with ease.

A feature-rich fork of wa-sticker-formatter

License Code Quality Downloads NPM Version


✨ Features

  • 🖼️ Supports static images, GIFs, and Videos (animated WebP output)
  • 🎨 Custom backgrounds, types, and categories
  • 🔗 Fluent method chaining API
  • 📦 Baileys-MD compatible output
  • 🔍 Metadata extraction from existing stickers
  • 📐 Multiple sticker types: Default, Crop, Full, Circle, Rounded
  • 🖋️ SVG input support

📦 Installation

npm i stickers-formatter

🚀 Quick Start

import { Sticker, StickerTypes } from 'stickers-formatter'

const sticker = new Sticker('./image.png', {
    pack: 'My Pack',
    author: 'Me',
    type: StickerTypes.FULL,
})

const buffer = await sticker.toBuffer()

📥 Import

import { Sticker, createSticker, StickerTypes } from 'stickers-formatter' // ES6
// const { Sticker, createSticker, StickerTypes } = require('stickers-formatter') // CommonJS

📖 Usage

Stickers-Formatter provides two ways to create stickers — the Sticker class and the createSticker function. Both accept the same parameters:

| Parameter | Type | Description | |-----------|------|-------------| | image | Buffer \| string | Buffer, URL, SVG string, or file path. GIFs and videos produce animated WebP. | | options | IStickerOptions | Configuration object (see Options) |


🏗️ Using the Sticker Class (Recommended)

const sticker = new Sticker(image, {
    pack: 'My Pack',
    author: 'Me',
    type: StickerTypes.FULL,
    categories: ['🤩', '🎉'],
    id: '12345',
    quality: 50,
    background: '#000000'
})

const buffer = await sticker.toBuffer()

await sticker.toFile('sticker.webp')

sock.sendMessage(jid, await sticker.toMessage())

Method Chaining

const buffer = await new Sticker(image)
    .setPack('My Pack')
    .setAuthor('Me')
    .setType(StickerTypes.FULL)
    .setCategories(['🤩', '🎉'])
    .setID('12345')
    .setBackground('#000000')
    .setQuality(50)
    .toBuffer()

SVG Input

const sticker = new Sticker(`
    <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
        <path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256 256-114.6 256-256S397.4 0 256 0z" fill="#ff0000" />
    </svg>
`, { author: 'Me', pack: 'SVG Pack' })

⚡ Using the createSticker Function

const buffer = await createSticker(image, options)

Returns a Promise<Buffer> — useful for functional-style code.


⚙️ Options

interface IStickerOptions {
    pack?: string
    author?: string
    id?: string
    categories?: Categories[]
    background?: Sharp.Color
    type?: StickerTypes | string
    quality?: number
}

| Option | Type | Default | Description | |--------|------|---------|-------------| | pack | string | '' | Sticker pack title | | author | string | '' | Sticker pack author | | id | string | auto-generated | Unique sticker pack ID | | categories | string[] | undefined | Array of emojis for categorization | | background | string \| object | transparent | Hex string or RGBA object | | type | StickerTypes | DEFAULT | How the image is fitted | | quality | number (0–100) | 100 | Output WebP quality |


📐 Sticker Types

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

| Type | Description | |------|-------------| | DEFAULT | Standard WhatsApp sticker sizing | | CROPPED | Crops the image to fit | | FULL | Fits the full image with optional background | | CIRCLE | Circular crop | | ROUNDED | Rounded corners |


🎨 Background

The background option accepts a hex string or a Sharp RGBA object.

background: '#FFFFFF'
background: {
    r: 255,
    g: 255,
    b: 255,
    alpha: 1
}

Background is only applied when using StickerTypes.FULL.


🔍 Metadata

WhatsApp stickers embed metadata (author, pack name, category) directly into the WebP file as Exif data.

Bold text = Pack title  |  Regular text = Author name

Sticker Category

Categories are arrays of emojis embedded in the sticker metadata. Learn more →

Extracting Metadata

import { extractMetadata, Sticker } from 'stickers-formatter'
import { readFileSync } from 'fs'

const file = readFileSync('sticker.webp')

const metadata = await extractMetadata(file)
// {
//   emojis: [],
//   'sticker-pack-id': '',
//   'sticker-pack-name': '',
//   'sticker-pack-publisher': ''
// }

const metadata2 = await Sticker.extractMetadata(file)

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to open an issue or submit a pull request.


📄 License

Distributed under the MIT License. See LICENSE for more information.


Made with ❤️ — Thanks for using Stickers-Formatter!