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

lbm-helpers

v1.1.1

Published

Thư viện tiện ích hỗ trợ xử lý các tác vụ phổ biến trong JavaScript/Node.js.

Downloads

246

Readme

LBM Helpers

Thư viện tiện ích hỗ trợ xử lý các tác vụ phổ biến trong JavaScript/Node.js.

📦 Cài đặt

npm i lbm-helpers sharp mime-types

🚀 Cách sử dụng

const __ = require('lbm-helpers')

📚 Danh sách các hàm

⏰ Xử lý thời gian

| Hàm | Mô tả | Ví dụ | |------|--------|--------| | __.getTime() | Lấy timestamp hiện tại | __.getTime()1709123456789 | | __.convertTimeToDate(time) | Chuyển timestamp thành ngày (dd-mm-yyyy) | __.convertTimeToDate(1709123456789)"28-02-2024" | | __.convertTimeToDateTime(time) | Chuyển timestamp thành ngày giờ (dd-mm-yyyy hh:mm:ss) | __.convertTimeToDateTime(1709123456789)"28-02-2024 15:30:45" | | __.convertDateToTime(dateStr) | Chuyển chuỗi ngày thành timestamp | __.convertDateToTime("28-02-2024")1709123456789 | | __.convertDateTimeToTime(dateTimeStr) | Chuyển chuỗi ngày giờ thành timestamp | __.convertDateTimeToTime("28-02-2024 15:30:45")1709123456789 | | __.getNowDate() | Lấy ngày hiện tại | __.getNowDate()"28-02-2024" | | __.getNowDateTime() | Lấy ngày giờ hiện tại | __.getNowDateTime()"28-02-2024 15:30:45" | | __.isValidDate(str) | Kiểm tra định dạng ngày/giờ hợp lệ | __.isValidDate("28-02-2024")true |

🔢 Xử lý số và chuỗi

| Hàm | Mô tả | Ví dụ | |------|--------|--------| | __.getUniqueCode(length) | Tạo mã ngẫu nhiên (chữ hoa + số) | __.getUniqueCode(6)"A7B2C9" | | __.removeVietnameseAccents(str) | Xóa dấu tiếng Việt | __.removeVietnameseAccents("Tiếng Việt")"Tieng Viet" | | __.formatPhoneNumber(phone) | Định dạng số điện thoại | __.formatPhoneNumber("0123456789")"0123-456-789" | | __.removeFormatPhoneNumber(phone) | Xóa định dạng số điện thoại | __.removeFormatPhoneNumber("0123-456-789")"0123456789" | | __.formatMoneyVietNam(amount) | Định dạng tiền Việt Nam | __.formatMoneyVietNam(1000000)"1,000,000" | | __.removeFormatMoneyVietNam(money) | Xóa định dạng tiền Việt Nam | __.removeFormatMoneyVietNam("1,000,000")1000000 | | __.formatStrSearch(str) | Chuẩn hóa chuỗi tìm kiếm | __.formatStrSearch("Tôi Yêu JS")"toiyeujs" | | __.convertNumberToVietnameseWords(num) | Đọc số thành chữ | __.convertNumberToVietnameseWords(1000000)"Một triệu đồng" |

🖼️ Xử lý hình ảnh

| Hàm | Mô tả | Ví dụ | |------|--------|--------| | __.convertBytesToMegabytes(bytes) | Chuyển đổi bytes sang MB | __.convertBytesToMegabytes(1048576)1.00 | | __.convertImageToBase64(file) | Chuyển ảnh thành base64 | __.convertImageToBase64(imageFile)"data:image/jpeg;base64,..." | | __.convertBase64ToImage(base64, path) | Chuyển base64 thành ảnh | __.convertBase64ToImage(base64String, "output.jpg") |

🔄 Xử lý dữ liệu

| Hàm | Mô tả | Ví dụ | |------|--------|--------| | __.convertMongooseObjectToJson(obj) | Chuyển Mongoose Object thành JSON | __.convertMongooseObjectToJson(mongooseObj){...} |

📝 Lưu ý

  • Thư viện yêu cầu cài đặt thêm các package: sharpmime-types
  • Định dạng ngày tháng mặc định: dd-mm-yyyy
  • Định dạng thời gian mặc định: dd-mm-yyyy hh:mm:ss
  • Hỗ trợ các định dạng ảnh: JPEG, PNG, WebP