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

ashiro-engine

v5.0.1

Published

Universal, framework-agnostic core engine for WhatsApp bots — AI fallback, uploader, plugin registry, health check, and more. Built by Azure Ashiro for the Lycount community.

Readme

░█████╗░░██████╗██╗░░██╗██╗██████╗░░█████╗░
██╔══██╗██╔════╝██║░░██║██║██╔══██╗██╔══██╗
███████║╚█████╗░███████║██║██████╔╝██║░░██║
██╔══██║░╚═══██╗██╔══██║██║██╔══██╗██║░░██║
██║░░██║██████╔╝██║░░██║██║██║░░██║╚█████╔╝
╚═╝░░╚═╝╚═════╝░╚═░░╚═╝╚═╝╚═╝░░╚═╝░╚════╝░

Ashiro Core Engine

v5.0.0 — "NEXUS"

Universal, framework-agnostic core engine untuk bot WhatsApp. AI fallback multi-provider, uploader multi-layer, plugin registry dengan hot-reload, health monitoring, dan masih banyak lagi — dalam satu package ringan.

npm version license node

Author: Azure Ashiro  •  Community: Lycount


Daftar Isi


Fitur Utama

| Modul | Deskripsi | |---|---| | 🧠 AI Fallback Engine | 7+ provider (OpenAI, xAI, Anthropic, DeepSeek, Gemini, Obscura, Local/Ollama) dengan auto-fallback berurutan. Bisa daftarkan provider sendiri. | | ☁️ Universal Uploader | 5 layer fallback: uguu → tmpfiles → catbox → litterbox → 0x0.st. Auto-detect MIME type dari buffer. | | 🧩 Plugin Registry | Auto-scan folder plugin manapun, hot-reload tanpa restart, dependency antar-plugin. | | 🩺 Health Check | Cek sistem, memory, network latency, dan status komponen. Mendukung output JSON untuk dashboard. | | 🧹 System Cleaner | Bersihkan cache panel/server, temp file, dan trigger garbage collection. | | 🚦 Middleware Pipeline | Satu alur untuk rate-limit, permission check, dan middleware custom sebelum command jalan. | | 📊 Metrics | Counter ringan untuk command, AI call, upload, dan error — real-time. | | 📝 Logger | 5 level log dengan warna ANSI, timestamp WIB, dan opsi file logging (rotating harian). | | ⚙️ Config Bridge | Auto-detect config.js / config.json / settings.js, dengan validasi ringan. | | 🔌 Framework Agnostic | Bisa dipasang ke source code bot WhatsApp apapun — Baileys, ourin-baileys, dan turunannya. |


Persyaratan

  • Node.js versi 18.0.0 atau lebih baru
  • npm (biasanya sudah termasuk saat instal Node.js)

Cek versi Node kamu:

node -v

Instalasi

Via npm (Desktop / VPS / Server)

# 1. Buat / masuk ke folder project bot kamu
mkdir ashiro-engine
cd ashiro-engine

# 2. Inisialisasi package.json (kalau belum ada)
npm init -y

# 3. Install Ashiro Core Engine
npm install ashiro-engine

Pastikan package.json project kamu punya "type": "module" karena engine ini pakai ES Modules:

{
  "type": "module"
}

Via Termux (Android)

# 1. Update paket Termux
pkg update && pkg upgrade -y

# 2. Install Node.js LTS
pkg install nodejs-lts -y

# 3. Cek instalasi
node -v
npm -v

# 4. Buat folder project
mkdir ashiro-engine
cd ashiro-engine

# 5. Inisialisasi & install
npm init -y
npm install ashiro-engine

💡 Tips Termux: kalau proses instalasi lambat atau gagal karena storage, jalankan termux-setup-storage dulu supaya Termux dapat izin akses penyimpanan.


Mulai Cepat

Buat file index.js di root project kamu:

import ashiro from "ashiro-engine";

await ashiro.init({
  pluginsDir: "./plugins",  // opsional
  logLevel: "info",
});

console.log("Ashiro Core Engine siap!");

Jalankan:

node index.js

Kalau berhasil, kamu akan melihat banner Ashiro dan status health check muncul di terminal.


Setup & Login

Engine ini bukan library koneksi WhatsApp itu sendiri (bukan Baileys) — dia adalah core engine pendukung yang kamu pasang di atas source code bot WhatsApp yang sudah kamu punya (Baileys, ourin-baileys, dll). Jadi "login" di sini maksudnya dua hal:

1. Setup Config Engine (API Key, dll)

Salin config.example.js dari package ke root project kamu sebagai config.js:

cp node_modules/ashiro-engine/config.example.js ./config.js

Lalu isi API key yang kamu punya (boleh kosongkan yang tidak dipakai):

// config.js
export default {
  APIkey: {
    openai:    "sk-...",
    xai:       "xai-...",
    anthropic: "sk-ant-...",
    deepseek:  "sk-...",
    obscura:   "",
  },
  geminiApiKey: "AIza...",
  universalAI: {
    baseUrl: "http://localhost:11434", // contoh Ollama lokal
    apiKey:  "",
    model:   "llama3",
  },
};

Engine otomatis mendeteksi file ini di root project kamu (bukan di dalam node_modules) saat ashiro.init() dipanggil.

2. Login Bot WhatsApp (di source code bot kamu)

Login/scan QR WhatsApp dilakukan oleh library bot kamu sendiri (misal Baileys), bukan oleh Ashiro Engine. Alurnya biasanya:

import { makeWASocket } from "baileys"; // atau ourin-baileys, dst
import ashiro from "ashiro-engine";

// 1. Inisialisasi Ashiro Core Engine dulu
await ashiro.init({ pluginsDir: "./plugins" });

// 2. Baru jalankan socket bot kamu seperti biasa (akan muncul QR code / pairing code)
const sock = makeWASocket({ /* ...konfigurasi socket kamu... */ });

// 3. Setelah connected, semua plugin & AI engine sudah siap dipakai
sock.ev.on("messages.upsert", async ({ messages }) => {
  const result = await ashiro.ai.ask("Halo!");
  // ...kirim balasan pakai sock.sendMessage(...)
});

Ashiro Engine menyediakan tools-nya (AI, uploader, cache, dll) — proses scan QR/pairing code tetap dari library WhatsApp yang kamu pakai.


Dokumentasi Modul

AI Fallback Engine

const result = await ashiro.ai.ask("Apa itu Lycount?");
console.log(result.answer, result.provider);

// Batasi hanya provider tertentu
await ashiro.ai.ask("Halo", { providers: ["anthropic", "openai"] });

// Daftarkan provider custom
ashiro.ai.registerProvider("myLLM", async (prompt, systemPrompt, cfg) => {
  // panggil API kamu sendiri
  return { answer: "jawaban dari LLM saya", provider: "My Custom LLM" };
});

Uploader

const url = await ashiro.uploader.upload(buffer, "foto.jpg", (percent, msg) => {
  console.log(percent, msg);
});

Plugin Registry + Hot-Reload

await ashiro.plugins.scan("./plugins");
ashiro.plugins.watch("./plugins"); // auto re-scan saat file berubah

ashiro.events.on("plugin:reloaded", (info) => {
  console.log("Plugin di-reload:", info);
});

Middleware Pipeline

ashiro.middleware.use(ashiro.middleware.rateLimitMiddleware("ping", 5));
ashiro.middleware.use(async (ctx, next) => {
  console.log("Sebelum command jalan:", ctx.command);
  await next();
});

await ashiro.middleware.run({ userId: "628xxx", command: "ping" }, async (ctx) => {
  // handler command asli
});

Metrics & Health Check

console.log(ashiro.metrics.snapshot());
// { commands: 12, aiCalls: 5, uploads: 2, errors: 0, uptimeMs: 123456 }

await ashiro.health.print();               // tampilkan di terminal
const json = await ashiro.health.run({ format: "json" }); // untuk dashboard

Logger

ashiro.log.info("Pesan info");
ashiro.log.success("Berhasil!");
ashiro.log.warn("Peringatan");
ashiro.log.error("Terjadi kesalahan");
ashiro.log.enableFileLogging(); // log juga ditulis ke ./logs/ashiro-YYYY-MM-DD.log

Struktur Plugin

Plugin adalah file .js di dalam folder plugins/ (atau folder custom yang kamu tentukan) yang meng-export config:

// plugins/ping.js
export const config = {
  name: "ping",
  alias: ["p"],
  category: "general",
  isEnabled: true,
  requires: [], // nama plugin lain yang jadi dependency (opsional)
};

export async function handler(m, { sock }) {
  await sock.sendMessage(m.chat, { text: "Pong! 🏓" });
}

Contoh Lengkap

Lihat examples/basic-usage.js untuk contoh yang bisa langsung dijalankan:

node examples/basic-usage.js

FAQ

Q: Apakah engine ini menghubungkan bot ke WhatsApp? Tidak. Ashiro Engine adalah lapisan pendukung (AI, uploader, plugin system, dll). Koneksi WhatsApp tetap pakai library seperti Baileys.

Q: Provider AI mana yang wajib diisi? Tidak ada yang wajib. Isi minimal satu API key di config.js — engine akan mencoba provider secara berurutan dan skip yang API key-nya kosong.

Q: Bisa dipakai di Termux tanpa VPS? Bisa, selama Node.js versi 18+ terinstal via pkg install nodejs-lts.

Q: Bagaimana cara pindah dari v4.0.0? Semua API publik v4 tetap berfungsi di v5 — cukup update import path ke package npm, tidak ada breaking changes.


Kontribusi

Pull request dan issue sangat diterima. Silakan buka issue di repository untuk laporan bug atau permintaan fitur.


Lisensi

MIT © 2026 Azure Ashiro — Lycount Community