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

@andikhadian/tanjiro

v1.2.0

Published

πŸ—‘οΈ CLI tool yang powerful untuk menganalisis dan membandingkan perubahan code migration antara branch Git dengan output terstruktur dalam format CSV atau Markdown

Readme

πŸ—‘οΈ Tanjiro

Tanjiro adalah CLI tool yang powerful untuk menganalisis dan membandingkan perubahan code migration antara branch Git dengan output yang terstruktur dalam format CSV atau Markdown.

πŸ“‹ Deskripsi Tools

Apa itu Tanjiro?

Tanjiro adalah tool command-line yang dirancang khusus untuk membantu developer dalam menganalisis perubahan kode antara branch Git. Tool ini menghasilkan laporan migration yang terstruktur, memudahkan tracking perubahan file, dan memberikan insight yang jelas tentang evolusi codebase.

Teknologi Utama

  • TypeScript - Bahasa pemrograman utama
  • Node.js - Runtime environment
  • Commander.js - CLI framework
  • Simple-git - Git operations
  • Chalk - Terminal styling
  • Ora - Loading spinners
  • fs-extra - Enhanced file system operations

Fitur Utama

  • πŸ” Perbandingan Branch: Analisis perubahan antara dua branch Git
  • πŸ“Š Multiple Output Format: Mendukung CSV dan Markdown
  • 🎯 Format Tabel Terstruktur: Output sesuai standar migration table
  • 🌐 Universal Compatibility: Dapat digunakan pada berbagai project Git
  • πŸ› οΈ Easy Installation: Install global via npm atau gunakan npx
  • 🎨 Beautiful CLI: Interface user-friendly dengan colors dan progress indicators
  • πŸ“ˆ Single Branch Analysis: Analisis perubahan pada branch tertentu
  • πŸ”„ Real-time Git Integration: Integrasi langsung dengan Git repository

πŸ—οΈ Arsitektur Sistem

Struktur Project

tanjiro/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts           # Entry point aplikasi
β”‚   β”œβ”€β”€ cli.ts             # CLI interface dan command handling
β”‚   β”œβ”€β”€ git-service.ts     # Git operations dan repository management
β”‚   β”œβ”€β”€ migration-parser.ts # Data parsing dan transformation
β”‚   β”œβ”€β”€ output-formatter.ts # Output generation (CSV/Markdown)
β”‚   β”œβ”€β”€ error-handler.ts   # Error handling utilities
β”‚   └── types.ts           # Type definitions
β”œβ”€β”€ dist/                  # Compiled JavaScript output
β”œβ”€β”€ package.json           # Package configuration
β”œβ”€β”€ tsconfig.json          # TypeScript configuration
└── README.md              # Dokumentasi

Komponen Utama

1. CLI Interface (cli.ts)

  • Menangani command-line arguments
  • Mengatur routing command
  • Menampilkan help dan usage information
  • Mengelola user interaction

2. Git Service (git-service.ts)

  • Validasi Git repository
  • Branch operations (list, validate, compare)
  • Git diff analysis
  • File status tracking

3. Migration Parser (migration-parser.ts)

  • Parsing Git diff output
  • Transformasi data ke format migration
  • File path processing
  • Metadata extraction

4. Output Formatter (output-formatter.ts)

  • Generate output dalam format CSV/Markdown
  • Console table formatting
  • File writing operations
  • Template rendering

πŸ“¦ Dependensi

Production Dependencies

{
  "commander": "^11.1.0",      // CLI framework
  "simple-git": "^3.20.0",    // Git operations
  "chalk": "^4.1.2",          // Terminal colors
  "ora": "^5.4.1",            // Loading spinners
  "fs-extra": "^11.1.1"       // File system utilities
}

Development Dependencies

{
  "@types/node": "^20.8.0",
  "@types/fs-extra": "^11.0.4",
  "typescript": "^5.2.2",
  "ts-node": "^10.9.1"
}

System Requirements

  • Node.js: >= 16.0.0
  • Git: Installed dan accessible via command line
  • Operating System: macOS, Linux, Windows

πŸš€ Instalasi

Global Installation

npm install -g tanjiro

Menggunakan npx (Tanpa Instalasi)

npx tanjiro <command>

Verifikasi Instalasi

tanjiro --version
tanjiro --help

πŸ“– Petunjuk Penggunaan

Command Dasar

1. Membandingkan Branch

# Format dasar
tanjiro compare -f <branch-asal> -t <branch-tujuan>

# Contoh
tanjiro compare -f main -t develop
tanjiro compare -f feature/login -t develop

2. Analisis Single Branch

# Melihat perubahan pada branch tertentu
tanjiro changes -b <branch-name>

# Contoh
tanjiro changes -b develop
tanjiro changes -b feature/user-management

3. Output ke File

# Output Markdown (default)
tanjiro compare -f main -t develop -o migration-report.md

# Output CSV
tanjiro compare -f main -t develop --format csv -o migration-report.csv
tanjiro changes -b develop --format csv -o changes.csv

4. Utility Commands

# Melihat daftar branch
tanjiro branches
# atau
tanjiro br

# Status repository
tanjiro status

# Bantuan
tanjiro help
tanjiro <command> --help

Options Lengkap

| Option | Alias | Description | Default | |--------|-------|-------------|---------| | --from <branch> | -f | Branch asal untuk perbandingan | Required | | --to <branch> | -t | Branch tujuan untuk perbandingan | Required | | --branch <branch> | -b | Branch untuk analisis single branch | Required | | --output <file> | -o | File output untuk menyimpan hasil | Optional | | --format <format> | | Format output: csv atau markdown | markdown | | --no-console | | Tidak menampilkan hasil di console | false |

Format Output

Tabel Migration

Output mengikuti format standar migration table:

| No | Library/Object | Type | Compile/Promote Date | Size (KBytes) | No | Library/Object | Type | Compile/Promote Date | Size (KBytes) | Remark | |----|----------------|------|----------------------|---------------|----|--------------------|------|----------------------|---------------|--------| | 1 | src/auth.ts | TS | 2024-01-15 | 2.45 | 1 | src/auth.ts | TS | 2024-01-15 | 2.67 | src |

Keterangan Remark

  • new: File baru yang ditambahkan
  • src: File yang dimodifikasi
  • other: File yang dihapus atau status lainnya

πŸ’‘ Contoh Penggunaan

Scenario 1: Basic Comparison

# Membandingkan main dengan develop branch
tanjiro compare -f main -t develop

Scenario 2: Export ke CSV untuk Deployment

# Generate CSV report untuk deployment tracking
tanjiro compare -f staging -t production --format csv -o deployment-migration.csv

Scenario 3: Feature Branch Analysis

# Analisis perubahan feature branch
tanjiro compare -f develop -t feature/user-management -o feature-analysis.md

Scenario 4: Silent Mode

# Generate report tanpa output console
tanjiro compare -f main -t develop -o report.md --no-console

Scenario 5: Single Branch Changes

# Melihat semua perubahan pada branch develop
tanjiro changes -b develop --format csv -o develop-changes.csv

πŸ”§ Troubleshooting

Error: "Direktori ini bukan repository Git yang valid"

Solusi:

  • Pastikan Anda berada di dalam direktori Git repository
  • Jalankan git status untuk memverifikasi
  • Inisialisasi Git repository jika belum ada: git init

Error: "Branch tidak ditemukan"

Solusi:

  • Gunakan tanjiro branches untuk melihat daftar branch yang tersedia
  • Pastikan nama branch sudah benar (case-sensitive)
  • Untuk remote branch, pastikan sudah di-fetch: git fetch origin

Error: "Permission denied"

Solusi:

  • Pastikan Anda memiliki akses read ke repository
  • Check file permissions pada direktori project
  • Untuk repository private, pastikan authentication sudah benar

Performance Issues

Solusi:

  • Untuk repository besar, pertimbangkan untuk menggunakan --no-console untuk output yang lebih cepat
  • Pastikan Git repository dalam kondisi clean (tidak ada uncommitted changes yang banyak)

πŸ“Š Output Examples

Console Output

πŸ“Š Migration Report: main β†’ develop
═══════════════════════════════════════════════════════════════════════════════════════════
| No | Library/Object      | Type  | Date       | Size  | No | Library/Object      | Type  | Date       | Size  | Remark |
|----|--------------------|----- -|------------|-------|----|--------------------|-------|------------|-------|--------|
| 1  | src/auth.service.ts | TS    | 2024-01-15 | 2.45  | 1  | src/auth.service.ts | TS    | 2024-01-15 | 2.67  | src    |
| 2  | src/user.model.ts   | TS    | 2024-01-15 | 1.23  | 2  | src/user.model.ts   | TS    | 2024-01-15 | 1.23  | new    |
═══════════════════════════════════════════════════════════════════════════════════════════
πŸ“ˆ Summary: 2 β†’ 2 files (4 total changes)

CSV Output

From: main
To: develop

No,Library / Object,Type,Compile / Promote Date,Size (KBytes),No,Library / Object,Type,Compile / Promote Date,Size (KBytes),Remark
1,"src/auth.service.ts",TS,2024-01-15,2.45,1,"src/auth.service.ts",TS,2024-01-15,2.67,src
2,"src/user.model.ts",TS,2024-01-15,1.23,2,"src/user.model.ts",TS,2024-01-15,1.23,new

🀝 Kontribusi

Kami menyambut kontribusi dari komunitas! Silakan baca CONTRIBUTING.md untuk panduan lengkap tentang cara berkontribusi.

Quick Start untuk Kontributor

  1. Fork repository ini
  2. Clone fork Anda: git clone <your-fork-url>
  3. Install dependencies: npm install
  4. Buat branch feature: git checkout -b feature/amazing-feature
  5. Develop dan test perubahan Anda
  6. Commit: git commit -m 'Add amazing feature'
  7. Push: git push origin feature/amazing-feature
  8. Buat Pull Request

πŸ“„ License

MIT License - lihat file LICENSE untuk detail lengkap.

πŸ™‹β€β™‚οΈ Support

Jika Anda mengalami masalah atau memiliki pertanyaan:

  1. Cek Issues yang sudah ada
  2. Buat issue baru jika diperlukan
  3. Sertakan informasi:
    • Versi Node.js (node --version)
    • Versi Tanjiro (tanjiro --version)
    • Operating System
    • Error message lengkap
    • Steps to reproduce

πŸš€ Roadmap

  • [ ] Support untuk Git hooks integration
  • [ ] Export ke format Excel
  • [ ] Integration dengan CI/CD pipelines
  • [ ] Web dashboard untuk visualisasi
  • [ ] Support untuk multiple repository comparison
  • [ ] Plugin system untuk custom formatters
  • [ ] Configuration file support
  • [ ] Advanced filtering options

πŸ“ˆ Changelog

v1.2.0

  • ✨ Renamed from GitFlow Migrator to Tanjiro
  • πŸ› Fixed file path prefix slash issue
  • πŸ”„ Synchronized CLI version with package.json
  • πŸ“ Updated documentation and help text

v1.1.0

  • ✨ Added changes command for single branch analysis
  • πŸ› Fixed output formatting issues
  • πŸ“Š Improved console table display

v1.0.0

  • πŸŽ‰ Initial release
  • ✨ Basic branch comparison functionality
  • πŸ“Š CSV and Markdown output support
  • 🎨 Beautiful CLI interface

Made with ❀️ for developers who love clean migration reports

Tanjiro - Slicing through Git diffs with precision βš”οΈ