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

vi-fix-js

v1.0.0

Published

Thư viện siêu nhẹ xử lý Tiếng Việt: chuẩn hóa dấu, bỏ dấu, CCCD, nhà mạng và nhiều hơn thế nữa!

Readme

vi-fix-js 🛠️

vi-fix-js là một thư viện JavaScript/Node.js mã nguồn mở siêu nhẹ (Zero Dependency), được tối ưu hóa để xử lý các bài toán đặc thù của Tiếng Việt như chuẩn hóa dấu, bỏ dấu, xử lý CCCD, nhà mạng và dữ liệu hành chính mới nhất.

🔗 Tài liệu hướng dẫn chi tiết: https://lib.mscrew.io.vn/vi-fix/js


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

  • Siêu nhẹ: Dung lượng chỉ khoảng 5KB, không phụ thuộc vào bất kỳ thư viện bên thứ ba nào.
  • Cập nhật 2026: Danh sách 34 tỉnh thành mới nhất theo phân cấp hành chính Việt Nam.
  • Thông minh: Phân tích sâu dữ liệu từ số CCCD (Giới tính, Năm sinh, Tỉnh thành).
  • Hiện đại: Hỗ trợ hoàn toàn ES Modules (ESM), tên hàm kiểu camelCase dễ dùng.

🚀 Cài đặt

Cài đặt thông qua npm:

npm install vi-fix-js

Hoặc thông qua yarn:

yarn add vi-fix-js

📖 Hướng dẫn sử dụng

Sử dụng import để bắt đầu (hỗ trợ tốt trong các framework hiện đại như React, Vue, Next.js hoặc Node.js mới):

import * as vf from 'vi-fix-js';

// 1. Chuẩn hóa dấu (hoà -> hòa)
console.log(vf.fix("Khánh Hoà bình yên")); // Output: Khánh Hòa bình yên

// 2. Bỏ dấu Tiếng Việt
console.log(vf.nosign("Tiếng Việt có dấu")); // Output: Tieng Viet co dau

// 3. Phân tích CCCD (12 số)
const info = vf.parseCccd("037098000123");
console.log(info); 
// Output: { gender: 'Nam', birth_year: 1998, province_code: '037', valid: true }

// 4. Kiểm tra nhà mạng
console.log(vf.getTelco("0961234567")); // Output: Viettel

// 5. Định dạng tiền tệ
console.log(vf.money(1500000)); // Output: 1.500.000đ

// 6. Đọc số thành chữ
console.log(vf.num2str("102", "vi")); // Output: một không hai

// 7. Danh sách 34 tỉnh thành (Update 2026)
const provinces = vf.getProvinces();
console.log(provinces.length); // Output: 34

🛠️ Danh sách 15 hàm tiện ích

| Hàm | Mô tả | |---|---| | fix(text) | Sửa vị trí đặt dấu thanh chuẩn (hoà -> hòa). | | nosign(text) | Chuyển văn bản có dấu thành không dấu. | | clean(text) | Loại bỏ khoảng trắng thừa giữa các từ. | | slug(text) | Tạo chuỗi định danh (slug) cho URL. | | vCaps(text) | Viết hoa chuẩn tên riêng Tiếng Việt. | | isVi(text) | Kiểm tra văn bản có chứa ký tự Tiếng Việt không. | | num2str(num, lang) | Chuyển dãy số thành chữ (Hỗ trợ vi/en). | | money(amount) | Định dạng số thành tiền tệ VNĐ (1.500.000đ). | | cleanPhone(phone) | Chuẩn hóa mọi định dạng SĐT về đầu số 0. | | getTelco(phone) | Nhận diện nhà mạng từ số điện thoại. | | getProvinces(format) | Lấy danh sách 34 tỉnh thành (list/json/str). | | isEmail(email) | Kiểm tra định dạng email hợp lệ. | | isCccd(number) | Kiểm tra định dạng CCCD 12 chữ số. | | parseCccd(cccd) | Phân tích Giới tính, Năm sinh, Tỉnh từ CCCD. | | genPass(length) | Tạo mật khẩu/OTP ngẫu nhiên nhanh. |


📄 Giấy phép (License)

Dự án này sử dụng giấy phép MIT License - Bạn có quyền tự do sử dụng, sửa đổi và phân phối.


✍️ Tác giả

Phát triển bởi MinhSangGD


💡 Xem thêm: Phiên bản dành cho Python