Gathering detailed insights and metrics for queen-amdi-wa-sticker
Gathering detailed insights and metrics for queen-amdi-wa-sticker
Gathering detailed insights and metrics for queen-amdi-wa-sticker
Gathering detailed insights and metrics for queen-amdi-wa-sticker
npm install queen-amdi-wa-sticker
Typescript
Module System
Node Version
NPM Version
63.7
Supply Chain
94.5
Quality
72.9
Maintenance
50
Vulnerability
97
License
TypeScript (100%)
Total Downloads
22,208
Last Day
6
Last Week
10
Last Month
18
Last Year
669
MIT License
106 Stars
259 Commits
48 Forks
5 Watchers
5 Branches
6 Contributors
Updated on Apr 13, 2025
Latest Version
1.0.2
Package Id
queen-amdi-wa-sticker@1.0.2
Unpacked Size
45.14 kB
Size
10.81 kB
File Count
29
NPM Version
8.19.2
Node Version
16.18.0
Cumulative downloads
Total Downloads
Last Day
500%
6
Compared to previous day
Last Week
400%
10
Compared to previous week
Last Month
38.5%
18
Compared to previous month
Last Year
-89.9%
669
Compared to previous year
Wa-Sticker-Formatter is a simple tool which allows you to create and format WhatsApp Stickers.
1> npm i wa-sticker-formatter
Wa-Sticker-Formatter provides two ways to create stickers. The paramers are the same for both.
First is the Buffer, SVG String, URL, SVG String or File path of static image, GIF or Video. The second is the options. GIFs and Videos will output an animated WebP file.
2nd Paramter, an object, Sticker Options accepts the following fields
pack
- The pack name.
author
- The author name.
type
- Value from StickeTypes enum (exported). Can be 'crop' or 'full' or undefined (default).
categories
- The sticker category. Can be an array of Emojis or undefined (default).
quality
- The quality of the output file. Can be an integer from 0 to 100. Defaults to 100.
id
- The sticker id. If this property is not defined, it will be generated.
background
- Background color in hexadecimal format or an RGBA Object. Defaults to undefined (transparent).
Before using the library, you need to import it.
1import { Sticker, createSticker, StickerTypes } from 'wa-sticker-formatter' // ES6 2// const { Sticker, createSticker, StickerTypes } = require('wa-sticker-formatter') // CommonJS
Sticker
constructor (Recommended)1const sticker = new Sticker(image, {
2 pack: 'My Pack', // The pack name
3 author: 'Me', // The author name
4 type: StickerTypes.FULL, // The sticker type
5 categories: ['🤩', '🎉'], // The sticker category
6 id: '12345', // The sticker id
7 quality: 50, // The quality of the output file
8 background: '#000000' // The sticker background color (only for full stickers)
9})
10
11const buffer = await sticker.toBuffer() // convert to buffer
12// or save to file
13await sticker.toFile('sticker.webp')
14
15// or get Baileys-MD Compatible Object
16conn.sendMessage(jid, await sticker.toMessage())
17
You can also chain methods like this:
1const buffer = await new Sticker(image) 2 .setPack('My Pack') 3 .setAuthor('Me') 4 .setType(StickerTypes.FULL) 5 .setCategories(['🤩', '🎉']) 6 .setId('12345') 7 .setBackground('#000000') 8 .setQuality(50) 9 .toBuffer()
The image
(first parameter) can be a Buffer, URL, SVG string, or File path.
1const sticker = new Sticker(`
2 <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
3 <path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256 256-114.6 256-256S397.4 0 256 0zm0 464c-119.1 0-216-96.9-216-216S136.9 40 256 40s216 96.9 216 216-96.9 216-216 216z" fill="#ff0000" />
4 </svg>
5`, { author: 'W3' })
createSticker
function1const buffer = await createSticker(buffer, options) // same params as the constructor 2// NOTE: `createSticker` returns a Promise of a Buffer
The following options are valid:
1interface IStickerConfig { 2 /** Sticker Pack title*/ 3 pack?: string 4 /** Sticker Pack Author*/ 5 author?: string 6 /** Sticker Pack ID*/ 7 id?: string 8 /** Sticker Category*/ 9 categories?: Categories[] 10 /** Background */ 11 background?: Sharp.Color 12 /** Sticker Type */ 13 type?: StickerTypes | string 14 /* Output quality */ 15 quality?: number 16}
Sticker types are exported as an enum.
1enum StickerTypes { 2 DEFAULT = 'default', 3 CROPPED = 'crop', 4 FULL = 'full' 5} 6
Background can be a hex color string or a sharp color object.
1{ 2 "background": "#FFFFFF" 3}
or
1{ 2 "background": { 3 "r": 255, 4 "g": 255, 5 "b": 255, 6 "alpha": 1 7 } 8}
Here's some basic information about WhatsApp Sticker Metadata.
In WhatsApp, stickers have their own metadata embedded in the WebP file as They hold info like the author, the title or pack name and the category.
The text on bold is the pack title and the rest is the author. This is actually Exif Metadata embedded in the WebP file.
This is an array of Emojis. Learn More
To extract the metadata from the WebP file, you can use the extractMetadata()
function.
1import { extractMetadata, Sticker } from 'wa-sticker-formatter' 2import { readFileSync } from 'fs' 3 4const sticker = readFileSync('sticker.webp') 5let metadata = await extractMetadata(sticker) // { emojis: [], 'sticker-pack-id': '', 'sticker-pack-name': '', 'sticker-author-name': '' } 6 7// or use the static method from the Sticker class 8metadata = await Sticker.extractMetadata(sticker) 9
Thanks for using Wa-Sticker-Formatter!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/27 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
39 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-04-28
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More