{"id":23200439,"url":"https://github.com/AlenVelocity/wa-sticker-formatter","last_synced_at":"2025-08-18T23:32:36.154Z","repository":{"id":40460646,"uuid":"349739367","full_name":"AlenVelocity/wa-sticker-formatter","owner":"AlenVelocity","description":"Sticker Creator for WhatsApp","archived":false,"fork":false,"pushed_at":"2024-02-23T14:29:00.000Z","size":12881,"stargazers_count":106,"open_issues_count":12,"forks_count":49,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-09T00:09:42.933Z","etag":null,"topics":["exif","image","nodejs","png","sharp","sticker","wa-sticker-formatter","webp","whatsapp-stickers"],"latest_commit_sha":null,"homepage":"https://alensaito1.github.io/wa-sticker-formatter/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlenVelocity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"alen01"}},"created_at":"2021-03-20T13:56:06.000Z","updated_at":"2025-06-08T17:33:34.000Z","dependencies_parsed_at":"2024-06-18T13:35:28.288Z","dependency_job_id":"bee6594d-2cdf-4a67-a738-8c4904b3428f","html_url":"https://github.com/AlenVelocity/wa-sticker-formatter","commit_stats":{"total_commits":242,"total_committers":7,"mean_commits":34.57142857142857,"dds":0.3677685950413223,"last_synced_commit":"7e92e22999b8d41df58e576562f57dba7dcdd013"},"previous_names":["alensaito1/wa-sticker-formatter"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/AlenVelocity/wa-sticker-formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fwa-sticker-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fwa-sticker-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fwa-sticker-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fwa-sticker-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlenVelocity","download_url":"https://codeload.github.com/AlenVelocity/wa-sticker-formatter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fwa-sticker-formatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271075889,"owners_count":24695088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exif","image","nodejs","png","sharp","sticker","wa-sticker-formatter","webp","whatsapp-stickers"],"created_at":"2024-12-18T15:10:47.031Z","updated_at":"2025-08-18T23:32:35.822Z","avatar_url":"https://github.com/AlenVelocity.png","language":"TypeScript","funding_links":["https://ko-fi.com/alen01"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\n\u003cimg src=\"https://img.icons8.com/color/96/000000/whatsapp--v5.png\" alt=\"wsf\"/\u003e\n\n# Wa-Sticker-Formatter\n\nWa-Sticker-Formatter is a simple tool which allows you to create and format WhatsApp Stickers.\n\n[![NPM](https://img.shields.io/npm/l/wa-sticker-formatter?style=flat-square\u0026label=License)](https://github.com/AlenVelocity/wa-sticker-formatter/blob/master/LICENSE) [![CodeFactor](https://img.shields.io/codefactor/grade/github/AlenVelocity/wa-sticker-formatter?style=flat-square\u0026label=Code%20Quality)](https://www.codefactor.io/repository/github/AlenVelocity/wa-sticker-formatter) [![NPM](https://img.shields.io/npm/dw/wa-sticker-formatter?style=flat-square\u0026label=Downloads)](https://npmjs.com/package/wa-sticker-formatter)\n\n\n\u003c/div\u003e\n\n# Installation\n\n```cmd\n\u003e npm i wa-sticker-formatter\n```\n\n# Usage\n\nWa-Sticker-Formatter provides two ways to create stickers.\nThe paramers are the same for both.\n\n1. 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.\n\n2. 2nd Paramter, an object, Sticker Options accepts the following fields\n\n`pack` - The pack name.\u003cbr\u003e\n`author` - The author name.\u003cbr\u003e\n`type` - Value from StickeTypes enum (exported). Can be 'crop' or 'full' or undefined (default).\u003cbr\u003e\n`categories` - The sticker category. Can be an array of Emojis or undefined (default).\u003cbr\u003e\n`quality` - The quality of the output file. Can be an integer from 0 to 100. Defaults to 100.\n`id` - The sticker id. If this property is not defined, it will be generated.\u003cbr\u003e\n`background` - Background color in hexadecimal format or an RGBA Object. Defaults to undefined (transparent).\u003cbr\u003e\n\n## Import\n\nBefore using the library, you need to import it.\n\n```TS\nimport { Sticker, createSticker, StickerTypes } from 'wa-sticker-formatter' // ES6\n// const { Sticker, createSticker, StickerTypes } = require('wa-sticker-formatter') // CommonJS\n```\n## Using The `Sticker` constructor (Recommended)\n\n```TS\nconst sticker = new Sticker(image, {\n    pack: 'My Pack', // The pack name\n    author: 'Me', // The author name\n    type: StickerTypes.FULL, // The sticker type\n    categories: ['🤩', '🎉'], // The sticker category\n    id: '12345', // The sticker id\n    quality: 50, // The quality of the output file\n    background: '#000000' // The sticker background color (only for full stickers)\n})\n\nconst buffer = await sticker.toBuffer() // convert to buffer\n// or save to file\nawait sticker.toFile('sticker.webp')\n\n// or get Baileys-MD Compatible Object\nconn.sendMessage(jid, await sticker.toMessage())\n\n```\n\nYou can also chain methods like this:\n\n```TS\nconst buffer = await new Sticker(image)\n    .setPack('My Pack')\n    .setAuthor('Me')\n    .setType(StickerTypes.FULL)\n    .setCategories(['🤩', '🎉'])\n    .setId('12345')\n    .setBackground('#000000')\n    .setQuality(50)\n    .toBuffer()\n```\n\nThe `image` (first parameter) can be a Buffer, URL, SVG string, or File path.\n\n### SVG Example\n```TS\nconst sticker = new Sticker(`\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"512\" height=\"512\" viewBox=\"0 0 512 512\"\u003e\n        \u003cpath 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\" /\u003e\n    \u003c/svg\u003e\n`, { author: 'W3' })\n```\n\n## Using the `createSticker` function\n\n```TS\nconst buffer = await createSticker(buffer, options) // same params as the constructor\n// NOTE: `createSticker` returns a Promise of a Buffer\n```\n\n## Options\n\nThe following options are valid:\n\n```TS\ninterface IStickerConfig {\n    /** Sticker Pack title*/\n    pack?: string\n    /** Sticker Pack Author*/\n    author?: string\n    /** Sticker Pack ID*/\n    id?: string\n    /** Sticker Category*/\n    categories?: Categories[]\n    /** Background */\n    background?: Sharp.Color\n     /** Sticker Type */\n    type?: StickerTypes | string\n    /* Output quality */\n    quality?: number\n}\n```\n\n## Sticker Types\n\nSticker types are exported as an enum.\n\n```ts\nenum StickerTypes {\n    DEFAULT = 'default',\n    CROPPED = 'crop',\n    FULL = 'full',\n    CIRCLE = 'circle,\n    ROUNDED = 'rounded'\n}\n\n```\n\n## Background\n\nBackground can be a hex color string or a sharp color object.\n```JSON\n{\n    \"background\": \"#FFFFFF\"\n}\n```\nor \n\n```JSON  \n{\n    \"background\": {\n        \"r\": 255,\n        \"g\": 255,\n        \"b\": 255,\n        \"alpha\": 1\n    }\n}\n```\n\n# Metadata\n\nHere's some basic information about WhatsApp Sticker Metadata.\n\nIn 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.\n\n### 1. Author and Pack Title\n\n\u003ca href=\"https://ibb.co/MhyzMwJ\"\u003e\u003cimg src=\"https://i.ibb.co/9vmxsKd/metadata.jpg\" alt=\"metadata\" border=\"0\" width=256\u003e\u003c/a\u003e\n\nThe text on bold is the pack title and the rest is the author.\nThis is actually [Exif](https://en.wikipedia.org/wiki/Exif) Metadata embedded in the WebP file.\n\n### 2 Sticker Category\n\nThis is an array of Emojis. [Learn More](https://github.com/WhatsApp/stickers/wiki/Tag-your-stickers-with-Emojis)\n\n\n### Extracting Metadata\nTo extract the metadata from the WebP file, you can use the `extractMetadata()` function.\n\n```TS\nimport { extractMetadata, Sticker } from 'wa-sticker-formatter'\nimport { readFileSync } from 'fs'\n\nconst sticker = readFileSync('sticker.webp')\nlet metadata = await extractMetadata(sticker) // { emojis: [], 'sticker-pack-id': '', 'sticker-pack-name': '', 'sticker-author-name': '' }\n\n// or use the static method from the Sticker class\nmetadata = await Sticker.extractMetadata(sticker)\n\n```\n\n---\nThanks for using Wa-Sticker-Formatter!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlenVelocity%2Fwa-sticker-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlenVelocity%2Fwa-sticker-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlenVelocity%2Fwa-sticker-formatter/lists"}