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

vietqr-zero

v1.0.0

Published

Zero-dependency VietQR library with bank list (base64 logos) and QR code generation

Downloads

10

Readme

VietQR-Zero

Zero-dependency VietQR library for Node.js and browsers. Generate VietQR payment codes and access Vietnamese bank information with pre-processed base64 logos.

Features

Zero Runtime Dependencies - No external packages required
🏦 Complete Bank List - All Vietnamese banks with logos (150px, WebP, base64)
💳 VietQR Generation - Create payment QR codes following VietQR standards
📦 Dual Module Support - ESM and CommonJS builds included
🔒 TypeScript Support - Full type definitions included

Installation

npm install vietqr-zero

Usage

Get Bank List

import { getBankList } from 'vietqr-zero';

const banks = getBankList();

banks.forEach(bank => {
  console.log(`${bank.shortName}: ${bank.name}`);
  // Logo is available as base64: bank.logoBase64
  // Use directly in img tag: <img src="${bank.logoBase64}" alt="${bank.shortName}" />
});

Generate VietQR Code

import { makeVietQRContent } from 'vietqr-zero';

const qrContent = makeVietQRContent({
  bankId: '970415',        // Bank BIN (use bank.bin field, e.g., '970415' for VietinBank)
  accountId: '1234567890', // Account number
  amount: 50000,           // Optional: amount in VND
  description: 'Payment'   // Optional: transaction description
});

// Use qrContent with any QR code generator library
console.log(qrContent);

Bank Data Structure

interface Bank {
  id: number;
  name: string;              // Full bank name
  code: string;              // Bank code (e.g., "ICB", "VCB")
  bin: string;               // Bank identification number (use as bankId for VietQR)
  shortName: string;         // Short display name
  logoBase64: string;        // Base64-encoded WebP logo (150px height)
  transferSupported: number; // 1 if transfer is supported
  lookupSupported: number;   // 1 if lookup is supported
  swiftCode: string | null;  // International SWIFT code
}

CommonJS Usage

const { getBankList, makeVietQRContent } = require('vietqr-zero');

const banks = getBankList();
const qrCode = makeVietQRContent({
  bankId: '970436',        // Use bank.bin field (e.g., '970436' for Vietcombank)
  accountId: '9876543210'
});

Building from Source

This package includes a build-time script that fetches the latest bank data and processes logos:

npm install          # Install dependencies
npm run build        # Build the package

The build process:

  1. Fetches bank data from VietQR API
  2. Downloads each bank's logo
  3. Resizes to max 150px height (maintains aspect ratio)
  4. Converts to WebP format
  5. Encodes to base64
  6. Compiles TypeScript to ESM and CommonJS

Zero Dependencies

This package has zero runtime dependencies. All bank logos are pre-processed during build time and included as base64 strings, eliminating the need for image processing libraries at runtime.

License

MIT

Contributing

Issues and pull requests are welcome at the main repository.