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

danz-bails

v1.1.0

Published

WhatsApp API — DanzBails custom build by danzzmy

Downloads

46

Readme

⚡ DANZ BAILS

WhatsApp Web API — custom build

forked, cleaned up, and rebuilt by @danzzmy

npm install Node License Channel

   ┌────────────────────────────────────┐
   │   D A N Z   B A I L S               │
   │   build 1.1.0 · @danzzmy             │
   └────────────────────────────────────┘

Baileys, but the terminal doesn't look like a stack trace threw up on it.

DanzBails is a modified build on top of the Baileys WhatsApp Web protocol library — websocket-based, no browser/Puppeteer required. This build focuses on three things stock forks usually skip: a terminal that's actually pleasant to stare at for 12 hours, dead code removed instead of piled on, and pairing that doesn't silently time out.

✨ What's different here

| | | |---|---| | 🎨 Styled console | Boxed banners, colored log levels, noisy session-log spam filtered out. No raw Pino JSON dump. | | 🔑 Pairing that survives | Auto-resolves the latest WA Web version before handshake — the #1 cause of pairing codes silently timing out. | | 🧹 No dead weight | Duplicate/unused legacy modules stripped out. Every file that ships is a file that's actually imported. | | 🧩 Extended message types | Payment requests, product cards, albums, events, poll results, native-flow interactive buttons. | | 🖼️ Sticker maker | Static and animated stickers, branded pack name/author baked into WEBP metadata. No external CLI tools required beyond ffmpeg. | | ⚡ Dev utilities | reply, downloadMedia, isRegistered, getJidType, broadcastMessage — the stuff every bot ends up rewriting anyway. | | 🏷️ Fully rebranded | No leftover strings from the base this was built on. Clean audit trail in CHANGELOG.md. |

🚀 Install

npm install github:danzzmy/Danz-Bails

⚡ Quickstart

import makeWASocket, { useMultiFileAuthState, createDanzLogger } from 'danz-bails'

const { state, saveCreds } = await useMultiFileAuthState('session')

const sock = makeWASocket({
	auth: state,
	logger: createDanzLogger(),
	printQRInTerminal: false
})

sock.ev.on('creds.update', saveCreds)

if (!sock.authState.creds.registered) {
	const code = await sock.requestPairingCode('6281234567890')
	// boxed pairing code banner prints automatically
}

sock.ev.on('connection.update', ({ connection }) => {
	if (connection === 'open') console.log('connected')
})

🖥️ Console output

Instead of this —

{"level":30,"time":1234567890,"msg":"connection update","update":{"connection":"open"}}

— you get this:

14:32:07  ● connected

Clean, timestamped, color-coded. Swap it in with one line:

logger: createDanzLogger()

📨 Extended message types

await sock.sendMessage(target, {
	groupStatusMessage: { text: "hello" }
})
await sock.sendMessage(target, {
	albumMessage: [
		{ image: buffer1, caption: "one" },
		{ image: { url: "https://example.com/img.jpg" }, caption: "two" }
	]
}, { quoted: m })
await sock.sendMessage(target, {
	eventMessage: {
		isCanceled: false,
		name: "Launch Night",
		description: "come through",
		location: { degreesLatitude: 0, degreesLongitude: 0, name: "TBA" },
		joinLink: "https://call.whatsapp.com/video/xxxx",
		startTime: "1763019000",
		endTime: "1763026200",
		extraGuestsAllowed: false
	}
}, { quoted: m })
await sock.sendMessage(target, {
	pollResultMessage: {
		name: "Best framework?",
		pollVotes: [
			{ optionName: "Node.js", optionVoteCount: "112" },
			{ optionName: "Deno", optionVoteCount: "3" }
		]
	}
}, { quoted: m })
await sock.sendMessage(target, {
	interactiveMessage: {
		header: "Promo Code",
		title: "Tap to copy",
		footer: "danz-bails",
		buttons: [{
			name: "cta_copy",
			buttonParamsJson: JSON.stringify({
				display_text: "Copy code",
				id: "123456789",
				copy_code: "ABC123XYZ"
			})
		}]
	}
}, { quoted: m })
await sock.sendMessage(target, {
	interactiveMessage: {
		header: "Limited Offer",
		title: "24h only",
		footer: "danz-bails",
		image: { url: "https://example.com/image.jpg" },
		nativeFlowMessage: {
			messageParamsJson: JSON.stringify({
				limited_time_offer: {
					text: "expires soon",
					url: "https://example.com",
					copy_code: "SAVE10",
					expiration_time: Date.now() + 86400000
				}
			}),
			buttons: [
				{ name: "single_select", buttonParamsJson: JSON.stringify({ has_multiple_buttons: true }) },
				{ name: "cta_copy", buttonParamsJson: JSON.stringify({ display_text: "Copy", id: "1", copy_code: "SAVE10" }) }
			]
		}
	}
}, { quoted: m })
await sock.sendMessage(target, {
	productMessage: {
		title: "Sample Product",
		description: "Product description here",
		thumbnail: { url: "https://example.com/image.jpg" },
		productId: "PROD001",
		retailerId: "RETAIL001",
		url: "https://example.com/product",
		body: "Details",
		footer: "Special price",
		priceAmount1000: 50000,
		currencyCode: "USD",
		buttons: [{
			name: "cta_url",
			buttonParamsJson: JSON.stringify({ display_text: "Buy now", url: "https://example.com/buy" })
		}]
	}
}, { quoted: m })
await sock.sendMessage(target, {
	requestPaymentMessage: {
		currency: "IDR",
		amount: 10000000,
		from: m.sender,
		background: {
			id: "100",
			fileLength: "0",
			width: 1000,
			height: 1000,
			mimetype: "image/webp",
			placeholderArgb: 0xFF00FFFF,
			textArgb: 0xFFFFFFFF,
			subtextArgb: 0xFFAA00FF
		}
	}
}, { quoted: m })

⚡ Dev utilities

A few shortcuts I got tired of rewriting in every project, so they're built in now.

// reply — quote a message without the sendMessage boilerplate
await sock.reply(jid, 'hello')
await sock.reply(jid, { image: buffer, caption: 'hi' }, m)

// downloadMedia — grab the buffer straight from a message, handles reupload retries
const buffer = await sock.downloadMedia(m)

// isRegistered — boolean shortcut over onWhatsApp
if (await sock.isRegistered('[email protected]')) { ... }

// getJidType — classify any JID in one call
sock.getJidType(jid) // 'group' | 'user' | 'broadcast' | 'newsletter' | 'status' | 'unknown'

// broadcastMessage — send to a list of JIDs with a delay between each,
// so you don't trip WhatsApp's anti-spam thresholds
await sock.broadcastMessage(jids, { text: 'hi' }, { delayMs: 1500 })

🖼️ Sticker maker

Convert any image or video/gif into a ready-to-send WhatsApp sticker, with your pack name and author baked into the WEBP metadata (shows up when someone taps "see sticker pack" in WhatsApp).

Static images use sharp if it's installed (fast path), otherwise fall back to ffmpeg. Animated stickers (video/gif) always use ffmpeg — make sure it's available on your system (ffmpeg -version to check).

import makeWASocket, { makeDanzSticker } from 'danz-bails'

// static image → sticker
const buffer = await makeDanzSticker(imageBuffer, {
	packname: 'DanzBails',
	author: '@danzzmy'
})

await sock.sendMessage(jid, { sticker: buffer })
// video/gif → animated sticker
const buffer = await makeDanzSticker(videoBuffer, {
	animated: true,
	seconds: 6,               // clip length cap, default 6s
	packname: 'DanzBails',
	author: '@danzzmy',
	categories: ['🔥', '⚡']   // emoji tags for the sticker
})

await sock.sendMessage(jid, { sticker: buffer })
sock.ev.on('messages.upsert', async ({ messages }) => {
	const m = messages[0]
	if (!m.message || m.key.fromMe) return

	const text = m.message.conversation || m.message.extendedTextMessage?.text
	if (text?.toLowerCase() !== 'sticker') return

	const quoted = m.message.extendedTextMessage?.contextInfo?.quotedMessage
	const target = quoted || m.message
	const isVideo = !!(target.videoMessage)
	const mediaMsg = target.imageMessage || target.videoMessage

	if (!mediaMsg) return sock.reply(m.key.remoteJid, 'reply to an image/video with "sticker"')

	const buffer = await sock.downloadMedia({ message: target })
	const sticker = await makeDanzSticker(buffer, {
		animated: isVideo,
		packname: 'DanzBails',
		author: '@danzzmy'
	})

	await sock.reply(m.key.remoteJid, { sticker }, m)
})

🛠️ Protocol reference

A couple of the lower-level calls the dev utilities above are built on, in case you need the raw form:

await sock.onWhatsApp(...phoneNumbers)             // check if number(s) are registered on WhatsApp
await sock.newsletterMetadata('invite', code)      // resolve a channel invite code to its JID + metadata

📋 Config flags

| Flag | Default | Description | |---|---|---| | danzAutoFollowChannel | true | Auto-follow the DanzBails WhatsApp channel on connect. Set false to opt out. |

📡 Channel

Join the DanzBails WhatsApp channel →

License

MIT — same as the upstream Baileys project this is built on.

built by @danzzmy