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

@o861runners/nmp

v1.260131.11633

Published

CLI tool to build, pack and publish NPM packages to multiple registries with auto-versioning

Readme

npm-multi-publish - Updated Version

🆕 Các thay đổi mới

Phiên bản này đã được cập nhật để giải quyết các vấn đề sau:

✅ Vấn đề đã giải quyết

  1. Publish lên nhiều host với package name khác nhau

    • Mỗi registry có thể có scope khác nhau
    • Tự động tạo package name phù hợp cho từng registry
  2. Tách riêng source tgz cho từng host

    • Mỗi registry có file .tgz riêng biệt
    • Tránh xung đột khi publish đồng thời
  3. Tự động tăng version

    • Format: 1.yy.mmdd.1hhMM
    • Ví dụ: 1.26.0130.11545 (30 Jan 2026, 15:45)
    • Đảm bảo mỗi lần publish đều có version mới
  4. NPX commands

    • Hướng dẫn chi tiết cách chạy trực tiếp từ các registry
    • Support cả Windows và Linux

📚 Tài liệu

  • SUMMARY.md - Tóm tắt ngắn gọn các thay đổi
  • CHANGES.md - Chi tiết đầy đủ về code changes
  • NPX.md - Hướng dẫn sử dụng npx commands

🚀 Quick Start

1. Config file

{
  "registries": {
    "npmjs": {
      "type": "npm",
      "token": "{{NPM_TOKEN}}",
      "enabled": true
    },
    "codeberg": {
      "type": "gitea",
      "url": "https://codeberg.org",
      "owner": "o861runners",
      "token": "{{CODEBERG_TOKEN}}",
      "enabled": true
    },
    "github": {
      "type": "github",
      "owner": "myusername",
      "repo": "myrepo",
      "token": "{{GITHUB_TOKEN}}",
      "enabled": true
    }
  }
}

2. Publish

export NPM_TOKEN=npm_xxxxx
export CODEBERG_TOKEN=xxxxx
export GITHUB_TOKEN=ghp_xxxxx

npm-multi-publish publish

3. Kết quả

Original package.json:

{
  "name": "my-package",
  "version": "1.0.0"
}

Packages được publish:

Files được tạo:

.npm-multi-publish-tmp/
├── npmjs-my-package-1.26.0130.11545.tgz
├── codeberg-o861runners-my-package-1.26.0130.11545.tgz
└── github-myusername-my-package-1.26.0130.11545.tgz

📝 Code Changes Overview

src/core/publisher.js

3 methods mới:

  1. generateVersion() - Auto-generate version
  2. createRegistryPackage() - Tạo package.json riêng cho registry
  3. packForRegistry() - Pack file .tgz riêng

Flow mới:

Original package.json
    ↓
For each registry:
    ↓
1. Create registry-specific package.json (with scope + new version)
    ↓
2. Backup original package.json
    ↓
3. Replace with registry-specific package.json
    ↓
4. npm pack → create .tgz
    ↓
5. Rename: registry-name-package-version.tgz
    ↓
6. Restore original package.json
    ↓
7. Publish .tgz to registry

🔍 Example Commands

Publish to all registries

npm-multi-publish publish

Publish to specific registries

npm-multi-publish publish --target npmjs,codeberg

Test from each registry

# NPM
npx --yes my-package hello

# Codeberg
npx --yes --registry=https://codeberg.org/api/packages/o861runners/npm/ @o861runners/my-package hello

# GitHub
npx --yes --registry=https://npm.pkg.github.com @myusername/my-package hello

📊 Version Format

Format: 1.yy.mmdd.1hhMM

Ví dụ:

  • 30/01/2026 15:45 → 1.26.0130.11545
  • 15/12/2026 09:30 → 1.26.1215.10930
  • 01/03/2027 23:59 → 1.27.0301.12359

Giải thích:

  • 1 - Fixed prefix
  • yy - 2 chữ số cuối của năm (26 = 2026)
  • mmdd - Tháng + ngày (0130 = 30 tháng 1)
  • 1 - Fixed separator
  • hhMM - Giờ + phút (1545 = 15:45)

→ Đảm bảo version luôn tăng dần theo thời gian

🎯 Benefits

Tách biệt hoàn toàn: Mỗi registry có file riêng ✅ Tự động hóa: Package name và version tự động đúng ✅ An toàn: Luôn backup và restore package.json gốc ✅ Dễ debug: Biết chính xác file nào publish đến đâu ✅ Không xung đột: Các registry không ảnh hưởng lẫn nhau

🔗 Links


Version: 1.1.0
Last Updated: 2026-01-30