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

bonz-sdk

v1.8.1

Published

SDK Zalo Client customized, drop-in replacement for zca-js, optimized for multi-language scripting (JS/TS/Python/Go) with Group, Interaction, Friend, and Tag APIs

Readme

👑 bonz-sdk v1.4.0

SDK Zalo Client customized, thiết kế tối giản, hiệu năng cao và tối ưu tuyệt đối cho lập trình đa ngôn ngữ (JavaScript, TypeScript, Python, Golang).

🚀 Tính năng nổi bật

  • Đăng nhập QR & Cookie thông minh: Tự động hiển thị mã QR trực tiếp trong Console/Terminal và lưu trữ cookie tự động.
  • Chuẩn hóa Event & Context: Event listener dạng EventEmitter mạnh mẽ, tự động chuẩn hóa data Zalo thành các hàm helper tiếng Việt / tiếng Anh trực quan (reply / guiTin, react / thaIcon, replyImage / guiAnh...).
  • Bridge đa ngôn ngữ siêu tốc: Tích hợp sẵn một local JSON-RPC server cực nhẹ để các tiến trình con bằng Python hoặc Go gọi API của Bot Zalo dễ dàng.

💻 Cài đặt

npm install bonz-sdk

🛠️ Hướng dẫn sử dụng

1. Khởi tạo Client & Lắng nghe Sự kiện (Node.js)

const { ZaloClient } = require("bonz-sdk");

const client = new ZaloClient({
  selfListen: false,       // Bỏ qua tin nhắn của chính Bot
  showTerminalQR: true,    // In mã QR ra terminal khi đăng nhập
  adminIds: ["123456789"]  // Danh sách UID Admin của Bot
});

async function start() {
  try {
    // Tự động đăng nhập bằng cookie đã lưu, nếu không có sẽ hiển thị QR để quét
    await client.login().catch(() => client.loginQR());
    
    // Lắng nghe tin nhắn
    client.listen(async (ctx) => {
      if (ctx.text === "ping") {
        await ctx.reply("pong!");
      }
      
      if (ctx.text === "info" && ctx.isAdmin()) {
        const name = await ctx.getName();
        await ctx.reply(`Xin chào Admin ${name}!`);
      }
    });
  } catch (err) {
    console.error("Lỗi khởi động:", err);
  }
}

start();

2. Viết tập lệnh Python (Python Bridge)

Khi bạn chạy một script Python từ bot, thư viện cung cấp một bridge bằng Python giúp gọi ngược lại Zalo API.

Cú pháp Python (my_script.py):

from bonz import reply, get_money, format_money

# Gửi tin nhắn phản hồi
reply("Xin chào từ Python script! 🐍")

# Lấy số tiền trong ví của người dùng hiện tại
money = get_money()
reply(f"Số tiền của bạn là: {format_money(money)}")

📁 Cấu trúc thư mục thư viện

bonz-sdk/
├── index.js              # Entrypoint chính
├── index.d.ts            # Khai báo kiểu dữ liệu TypeScript
├── src/
│   ├── ZaloClient.js     # Class xử lý kết nối, login và lưu session
│   ├── ZaloContext.js    # Class đóng gói sự kiện và helper API
│   └── ZaloBridge.js     # JSON-RPC Server phục vụ gọi API đa ngôn ngữ
└── bridge/
    ├── python/
    │   └── bonz.py       # Thư viện Python liên kết IPC
    └── go/
        └── bonz.go       # Thư viện Go liên kết IPC

📄 Bản quyền

Bản quyền thuộc về Bonz VIP © 2026. Phát hành dưới giấy phép MIT. Website: bonzvip.site