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

f-baileys

v1.0.1

Published

πŸš€ Fast & Stable WhatsApp Bot Library β€” Pairing Code + QR Code Support, Multi-Platform (Termux/VPS/Panel), Full Dependency Auto-Installer

Readme

f-baileys πŸš€

Fast Β· Stable Β· Multi-Platform WhatsApp Bot Library
Pairing Code βœ“ | QR Code βœ“ | Auto-Install βœ“ | Termux/VPS/Panel βœ“

npm version License: MIT Node


✨ Features

| Feature | Status | |---------|--------| | Pairing Code login (100% masuk) | βœ… | | QR Code login | βœ… | | Auto-reconnect on disconnect | βœ… | | Multi-platform support | βœ… | | Auto-install missing dependencies | βœ… | | Serialized message objects | βœ… | | Send Text/Image/Video/Audio/Sticker/Document | βœ… | | TypeScript definitions | βœ… | | Pterodactyl Panel compatible | βœ… | | Termux (F-Droid) compatible | βœ… |


πŸ“¦ Install

npm install f-baileys

Saat install, f-baileys otomatis mendeteksi platform dan menginstall dependensi yang kurang.


πŸš€ Quick Start

Mode QR Code

const FBaileys = require('f-baileys');

const bot = new FBaileys({
  sessionPath: './session',
  usePairingCode: false,  // QR Code mode
  printQR: true,
  autoReconnect: true,
});

bot.on('open', () => console.log('βœ“ Connected!'));

bot.on('message', async (msg) => {
  if (msg.fromMe) return;
  if (msg.text === 'ping') {
    await msg.reply('Pong! πŸ“');
  }
});

bot.connect();

Mode Pairing Code

const FBaileys = require('f-baileys');

const bot = new FBaileys({
  sessionPath: './session',
  usePairingCode: true,          // ← Pairing Code
  phoneNumber: '628xxxxxxxxxx',  // Nomor HP (tanpa + atau spasi)
  autoReconnect: true,
});

bot.on('open', () => console.log('βœ“ Connected via Pairing Code!'));
bot.on('message', async (msg) => {
  if (msg.text === 'halo') await msg.reply('Halo juga!');
});

bot.connect();

βš™οΈ Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | sessionPath | string | './f_session' | Folder simpan session | | usePairingCode | boolean | false | true = pairing code, false = QR | | phoneNumber | string | null | Nomor HP untuk pairing code | | printQR | boolean | true | Auto print QR ke terminal | | logLevel | string | 'silent' | 'silent' / 'info' / 'debug' | | autoReconnect | boolean | true | Auto reconnect saat putus | | reconnectDelay | number | 3000 | Delay reconnect (ms) | | baileysOptions | object | {} | Extra config ke makeWASocket |


πŸ“¨ Message Object

Setiap pesan yang diterima sudah diserialisasi:

bot.on('message', async (msg) => {
  msg.id         // ID pesan
  msg.from       // JID pengirim/grup
  msg.sender     // JID pengirim (di dalam grup)
  msg.senderNum  // Nomor pengirim (tanpa @s.whatsapp.net)
  msg.fromMe     // true jika pesan dari bot sendiri
  msg.isGroup    // true jika pesan dari grup
  msg.text       // Isi teks pesan
  msg.type       // Tipe pesan (imageMessage, videoMessage, dll)
  msg.pushName   // Nama pengirim
  msg.timestamp  // Unix timestamp

  // Flags
  msg.isText     // Pesan teks
  msg.isImage    // Pesan gambar
  msg.isVideo    // Pesan video
  msg.isAudio    // Pesan audio
  msg.isSticker  // Pesan stiker
  msg.isDocument // Pesan dokumen

  // Quoted message
  msg.quoted?.body   // Teks quoted
  msg.quoted?.type   // Tipe quoted

  // Helpers
  await msg.reply('Teks')          // Balas pesan
  await msg.react('βœ…')            // Reaksi emoji
});

πŸ“€ Send Methods

// Teks
await bot.sendText(jid, 'Hello!');
await bot.sendText(jid, 'Reply!', quotedMsg);

// Gambar
await bot.sendImage(jid, './gambar.jpg', 'Caption');
await bot.sendImage(jid, 'https://..../img.jpg', 'Caption');

// Video
await bot.sendVideo(jid, './video.mp4', 'Caption');

// Audio
await bot.sendAudio(jid, './audio.mp3');
await bot.sendAudio(jid, './voice.ogg', true); // ptt = voice note

// Sticker
await bot.sendSticker(jid, './sticker.webp');

// Dokumen
await bot.sendDocument(jid, './file.pdf', 'dokumen.pdf', 'application/pdf');

// Reaksi
await bot.sendReaction(jid, msg.key, 'πŸ”₯');

// Typing indicator
await bot.sendTyping(jid, 2000); // Typing selama 2 detik

// Download media dari pesan
const buffer = await bot.downloadMedia(msg);

🌍 Platform Support

| Platform | Status | |----------|--------| | VPS Linux (Ubuntu/Debian/CentOS) | βœ… | | Termux (Google Play) | βœ… | | Termux (F-Droid) | βœ… | | Pterodactyl Panel | βœ… | | Docker | βœ… | | Windows | βœ… | | macOS | βœ… |


πŸ“¦ Dependencies (Auto-Install)

Saat npm install f-baileys, package berikut otomatis diinstall jika belum ada:

| Package | Fungsi | |---------|--------| | @whiskeysockets/baileys | Core WhatsApp MD | | sharp | Image processing (WebP, resize, dll) | | jimp | Pure JS image processing | | fluent-ffmpeg | FFmpeg wrapper (convert audio/video) | | ffmpeg-static | Binary FFmpeg | | ytdl-core | YouTube downloader | | webp-converter | Konversi ke WebP (sticker) | | color | Manipulasi warna | | chalk | Warna terminal | | qrcode-terminal | Print QR di terminal | | axios | HTTP requests | | pino | Logger |

Untuk Termux: f-baileys otomatis menjalankan pkg install ffmpeg nodejs juga.


πŸ“± Pairing Code Guide

  1. Jalankan bot dengan usePairingCode: true
  2. Kode 8 digit akan muncul di terminal (format: XXXX-XXXX)
  3. Buka WhatsApp di HP β†’ Perangkat Tertaut β†’ Tautkan Perangkat
  4. Pilih Tautkan dengan Nomor Telepon
  5. Masukkan kode yang tampil di terminal
  6. Selesai! βœ“

πŸ”§ Events

bot.on('qr',           (qr) => { ... })          // QR string
bot.on('open',         (sock) => { ... })         // Connected
bot.on('close',        ({ reason, code }) => {})  // Disconnected
bot.on('message',      (msg) => { ... })          // Pesan masuk
bot.on('logout',       () => { ... })             // Session logout
bot.on('group-update', (update) => { ... })       // Update grup

πŸ›  Utility

// Convert nomor ke JID
FBaileys.toJid('628123456789')        // β†’ [email protected]
FBaileys.toGroupJid('120363xxxxxx')   // β†’ [email protected]

πŸ“„ License

MIT Β© f-baileys