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 🙏

© 2025 – Pkg Stats / Ryan Hefner

borutowaileysss

v6.12.71

Published

A powerful enhanced library for building WhatsApp applications and bots

Readme

borutowaileysss

a WebSockets-based TypeScript library for interacting with the WhatsApp Web API. borutowaileysss It offers 2 methods of connecting to whatsapp web through your script, QR code authentication, and if you don't have a camera available, you can use the pairing code method, you will receive an association code consisting of 8 digits ex UOQWERTQ, which you enter into whatsapp at the linked device to connect, this is not baileys, It may seem similar to Baileys, but besides that, the @borutowaileys/Library is designed specifically to have more power when it comes to WhatsApp bots,Automations, etc.
IN YOUR CODE you will use : // Import the complete package and destructure what you need import pkg from 'borutowaileysss'; const { makeWASocket, useMultiFileAuthState,

GitHub Repository: https://github.com/gyovannyvpn123/borutowaileys-library.git


đ Features

  • Multi-Device Support: Connect across multiple sessions seamlessly.
  • Robust Messaging: Send and receive text, stickers, and rich media.
  • Group Management: Create, schedule actions, and manage permissions.
  • Advanced Media Handling: Compress, resize, watermark, and OCR.
  • Code-Free Authentication: QR-less pairing for headless environments.
  • Event-Driven Architecture: React to incoming messages, connection updates, and more.
  • State Synchronization: Keep message history in sync across devices.
  • Webhook Integrations: Push events to external services.
  • Built-In Rate Limiter: Stay within WhatsAppâs limits to avoid blocks.
  • Cache with TTL: In-memory storage with persistence and automatic expiration.

đŚ Installation

npm install borutowaileysss

đ Quick Start


// index.cjs
// This is a simple WhatsApp bot using the borutowaileysss.
// It connects to WhatsApp Web using a QR code, asks for a phone number, and sends a test message.
// You can extend this script as much as you like â see comments below!

const {
  makeWASocket,
  useMultiFileAuthState,
  DisconnectReason,
  fetchLatestBaileysVersion,
  delay
} = require('borutowaileysss');

const readline = require('readline');
const qrcode = require('qrcode-terminal');

// đ˛ Show the QR code in the terminal so the user can scan it with WhatsApp
const displayQRCode = (qr) => {
  console.log('\nđˇ Scan the QR code below using WhatsApp (Settings > Linked Devices > Link a device):\n');
  qrcode.generate(qr, { small: true });
};

// đ Ask user to enter a phone number to send a message to
const askPhoneNumber = () => {
  return new Promise((resolve) => {
    const rl = readline.createInterface({
      input: process.stdin,
      output: process.stdout
    });
    rl.question('\nđ Enter a phone number to send a message (e.g. 123456789): ', (input) => {
      rl.close();
      resolve(input.trim());
    });
  });
};

// đ Handle connection events and pairing
const waitForPairing = (sock) => {
  sock.ev.on('connection.update', async ({ connection, qr, lastDisconnect }) => {
    if (connection === 'close') {
      const reason = lastDisconnect?.error?.output?.statusCode;
      if (reason === DisconnectReason.loggedOut) {
        console.error('â ď¸ You have been logged out. Please re-authenticate.');
        process.exit();
      } else {
        console.log('đ Trying to reconnect...');
        startBot(); // Restart connection
      }
    }

    if (qr) {
      displayQRCode(qr); // Show QR code
    }

    if (connection === 'open') {
      console.log('\nâ Successfully connected to WhatsApp!');
      await delay(2000);

      // đĽ Ask for phone number and send message
      const phone = await askPhoneNumber();
      const jid = `${phone}@s.whatsapp.net`;

      await sock.sendMessage(jid, { text: 'đ Hello! This is a message from your Boruto bot.' });
      console.log(`đ¨ Message sent to ${phone}`);

      // đĄ You can extend this to send images, audio, or messages from files!
      // Example ideas:
      // - Read from a .txt file and send multiple messages
      // - Use a loop to send messages every X seconds
      // - Send to a group instead of a single contact
    }
  });
};

// đ Start the WhatsApp bot
async function startBot() {
  const { version } = await fetchLatestBaileysVersion();
  const { state, saveCreds } = await useMultiFileAuthState('./auth');

  const sock = makeWASocket({
    version,
    auth: state,
    printQRInTerminal: false, // QR is printed manually using qrcode-terminal
    browser: ['Boruto', 'Termux', '1.0.0'],
  });

  sock.ev.on('creds.update', saveCreds);
  waitForPairing(sock);
}

// đ˘ Start everything
startBot();




đ Advanced Capabilities

Rate Limiting

Keep your bot safe from blocks by capping request rates.

const { createEnhancedSocket } = require('borutowaileysss');

const sock = createEnhancedSocket({
  rateLimiter: { maxRequests: 15, timeWindow: 60000 }
});

try {
  await sock.sendWithRateLimit(jid, { text: 'This message respects rate limits' });
} catch (err) {
  console.error(err.message);
}

Image Processing & OCR

Extract text and manipulate media in one place.

// Text extraction
const text = await sock.extractTextFromImage(imageBuffer);
console.log('Extracted text:', text);

// Compress, resize, watermark
const compressed = await sock.compressImage(imageBuffer, 80);
const resized    = await sock.resizeImage(imageBuffer, 800, 600);
const watermarked = await sock.addWatermark(imageBuffer, watermarkBuffer, { opacity: 0.5, x: 10, y: 10 });

Group Administration

Automate group creation, scheduling, and moderation.

// Create advanced group
const group = await sock.createGroupWithOptions(
  'My Awesome Group',
  ['[email protected]'],
  { description: 'Group for enthusiasts', picture: fs.readFileSync('icon.jpg'), restrict: true }
);

// Schedule an action
await sock.scheduleGroupAction(
  group.id,
  'message',
  Date.now() + 3600000,
  { message: { text: 'Scheduled announcement' } }
);

Webhook Integrations

Real-time events delivered to your services.

sock.setupWebhook('https://example.com/webhook', ['message.received', 'message.sent']);

await sock.sendMessage(jid, { text: 'Silent message' }, { silentWebhook: true });

sock.removeWebhook('https://example.com/webhook');

Built-In Caching

Fast in-memory store with TTL and persistence.

sock.cacheSet('user:1234', userData, 3600); // 1 hour
const data = sock.cacheGet('user:1234');
sock.cacheClear();

đ Documentation

Explore the full API, guides, and examples in the docs folder or online at https://borutowaileys.dev/docs


âď¸ License

Released under the MIT License.