{"id":29866594,"url":"https://github.com/namitkewat/zvm.js","last_synced_at":"2026-04-05T21:03:09.478Z","repository":{"id":306172570,"uuid":"1024267610","full_name":"namitkewat/zvm.js","owner":"namitkewat","description":"A simple, cross-platform Zig version manager written in pure JavaScript.","archived":false,"fork":false,"pushed_at":"2025-07-24T01:28:34.000Z","size":295,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-24T04:42:04.706Z","etag":null,"topics":["bunjs","ci-cd","cross-platform","deno","developer-tools","nodejs","version-manager","zig","zig-language","ziglang","zvm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namitkewat.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-22T12:40:51.000Z","updated_at":"2025-07-24T01:28:37.000Z","dependencies_parsed_at":"2025-07-24T04:42:09.028Z","dependency_job_id":"d43c462b-6133-4f8f-b587-be618ed5a861","html_url":"https://github.com/namitkewat/zvm.js","commit_stats":null,"previous_names":["namitkewat/zvm.js"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/namitkewat/zvm.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namitkewat%2Fzvm.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namitkewat%2Fzvm.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namitkewat%2Fzvm.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namitkewat%2Fzvm.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namitkewat","download_url":"https://codeload.github.com/namitkewat/zvm.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namitkewat%2Fzvm.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267873768,"owners_count":24158692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bunjs","ci-cd","cross-platform","deno","developer-tools","nodejs","version-manager","zig","zig-language","ziglang","zvm"],"created_at":"2025-07-30T13:00:54.574Z","updated_at":"2025-12-30T21:54:48.789Z","avatar_url":"https://github.com/namitkewat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zvm - The Zig Version Manager (JavaScript Edition)\r\n\r\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\r\n![Platform Support](https://img.shields.io/badge/platform-linux%20|%20macOS%20|%20windows-blue)\r\n![Runtime Support](https://img.shields.io/badge/runtime-Node.js%20|%20Deno%20|%20Bun-green)\r\n\r\nA lightweight, cross-platform solution for managing multiple Zig compiler versions\r\n\r\n## Why zvm.js?\r\n\r\nUnlike other Zig version managers written in Go or Zig, this JavaScript implementation offers:\r\n\r\n* **🛠️ Single-file implementation** - Pure JavaScript with no dependencies beyond `tar`\r\n* **🌐 Cross-platform support** - Works on Linux, macOS, and Windows (PowerShell \u0026 CMD)\r\n* **⚡ Runtime agnostic** - Runs with Node.js, Deno, or Bun\r\n* **👩‍💻 Beginner-friendly** - Easy to understand and modify with basic scripting knowledge\r\n* **⚙️ No toolchain lock-in** - Modify behavior instantly without compile steps or maintainer dependencies\r\n* **🏷️ Aliasing** - Assign custom names to installed versions\r\n* **📁 Project-specific versions** - Auto-detects `.zig-version` files\r\n* **🔁 Mirror support** - Downloads from fastest available community mirror\r\n* **🎨 Colorized output** - Intuitive terminal interface\r\n* **🔧 Atomic operations** - Safe installation with retry logic\r\n\r\n## Prerequisites\r\n\r\n1.  **A JavaScript Runtime:** You need one of the following installed:\r\n    * [Node.js](https://nodejs.org/) (v16+)\r\n    * [Bun](https://bun.sh/)\r\n    * [Deno](https://deno.land/)\r\n\r\n2.  **`tar` command:** The script uses the system's `tar` command to extract archives.\r\n    * **Linux/macOS:** `tar` is pre-installed.\r\n    * **Windows:** `tar` is included with [Git for Windows](https://git-scm.com/download/win). Ensure Git's `bin` directory is in your system `PATH`.\r\n\r\n---\r\n\r\n## Installation\r\n\r\n1.  **Download `zvm.js`**\r\n\r\n    Download the `zvm.js` script from this repository.\r\n\r\n2.  **Place it in your PATH**\r\n\r\n    Move the script to a directory that is part of your system's `PATH` and make it executable.\r\n\r\n    **For Linux \u0026 macOS:**\r\n\r\n    ```bash\r\n    # Download zvm\r\n    curl -fsSL https://raw.githubusercontent.com/namitkewat/zvm.js/refs/heads/main/zvm.js \u003e /usr/local/bin/zvm\r\n    chmod +x /usr/local/bin/zvm\r\n\r\n    # Initialize zvm\r\n    zvm init\r\n\r\n    # Add to your shell profile (shown after init)\r\n    source ~/.zvm/zvm.sh\r\n    ```\r\n\r\n    **For Windows:**\r\n\r\n    * Create a directory like `C:\\bin`.\r\n    * Add this directory to your system's `PATH` environment variable.\r\n    * Move `zvm.js` into `C:\\bin` and rename it to `zvm.js`.\r\n    * Create a batch file named `zvm.cmd` in the same directory with the following content:\r\n        ```batch\r\n        @echo off\r\n        node \"%~dp0\\zvm.js\" %*\r\n        ```\r\n\r\n3.  **Initialize `zvm`**\r\n\r\n    Run the `init` command to generate the necessary shell configuration scripts.\r\n\r\n    ```bash\r\n    zvm init\r\n    ```\r\n\r\n    This will display platform-specific instructions. Follow them to complete the setup for your shell (e.g., adding a `source` command to your `~/.bashrc` or PowerShell profile).\r\n\r\n4.  **Restart Your Shell**\r\n\r\n    Close and reopen your terminal or run the provided `source` command to apply the changes. `zvm` is now ready to use!\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n```bash\r\n# Install latest stable version\r\nzvm install 0.14.1 --alias stable\r\n\r\n# Use in current shell\r\nzvm use stable\r\n\r\n# Verify installation\r\nzig version\r\n\r\n# Install development build\r\nzvm install 0.15.0-dev.1175+e4abdf5a1 --alias dev\r\n\r\n# Switch between versions\r\nzvm use dev\r\n```\r\n\r\n## Command Reference\r\n\r\n| Command | Description | Example |\r\n|---------|-------------|---------|\r\n| `zvm init` | Setup shell integration | `zvm init` |\r\n| `zvm install` | Install Zig version | `zvm install 0.14.1 --alias stable` |\r\n| `zvm use` | Activate version | `zvm use stable` |\r\n| `zvm list` | Show installed versions | `zvm list` |\r\n| `zvm list-remote` | Show available versions | `zvm list-remote` |\r\n| `zvm alias` | Manage version aliases | `zvm alias dev 0.15.0-dev.1175` |\r\n| `zvm current` | Show active version | `zvm current` |\r\n| `zvm uninstall` | Remove version | `zvm uninstall 0.13.0` |\r\n| `zvm deactivate` | Deactivate current version | `zvm deactivate` |\r\n\r\n\r\n## Docker Integration\r\n\r\nSample Dockerfile\r\n\r\n```Dockerfile\r\n# Fedora-based development container\r\nFROM public.ecr.aws/docker/library/fedora:43\r\n\r\n# Install dependencies\r\nRUN dnf update -y \u0026\u0026 \\\r\n    dnf install -y git tar unzip nodejs \u0026\u0026 \\\r\n    dnf clean all\r\n\r\n# Install zvm\r\nADD https://raw.githubusercontent.com/namitkewat/zvm.js/refs/heads/main/zvm.js /usr/local/bin/zvm\r\nRUN chmod +x /usr/local/bin/zvm\r\n\r\n# Set up environment\r\nRUN zvm init\r\nENV PATH=\"/root/.zvm/shims/active:${PATH}\"\r\n\r\n# Install Zig versions\r\nARG ZIG_STABLE=0.14.1\r\nARG ZIG_DEV=0.15.0-dev.1160+e43617e68\r\nRUN zvm install $ZIG_STABLE --alias stable\r\nRUN zvm install $ZIG_DEV --alias dev\r\nRUN zvm use stable\r\n\r\n# Verify installation\r\nRUN zig version\r\n\r\n# Default working directory\r\nWORKDIR /app\r\n```\r\n\r\n\r\n## Project Configuration\r\n\r\nAdd a `.zig-version` file to your project root:\r\n\r\n```bash\r\n# .zig-version\r\n0.14.1\r\n```\r\n\r\nzvm will automatically use this version when you enter the project directory.\r\n\r\n## Performance Tips\r\n\r\n1. **Mirror Prioritization**: zvm tests community mirrors for fastest download\r\n2. **Atomic Installs**: Uses temp directories and atomic renames\r\n3. **Alias Caching**: Aliases are stored for quick version switching\r\n4. **Batch Operations**: Install multiple versions in Docker builds\r\n\r\n## Troubleshooting\r\n\r\n**Windows Anti-virus Slowdown**:\r\n```bash\r\n# If you see rename retries during install:\r\n⚠️  Rename failed, retrying in 300ms... (1/5)\r\n```\r\nThis is normal - zvm.js automatically retries operations blocked by real-time scanning.\r\n\r\n**Missing `tar` on Windows**:\r\n```bash\r\nInstall Git for Windows and ensure its bin directory is in PATH\r\n```\r\n\r\n## Screenshots\r\n\r\n### Gallery of ZVM.js in Action\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003ctable\u003e\r\n    \u003ctr\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg src=\"images/one.png\" width=\"300\" alt=\"Version listing and installation\"\u003e\r\n        \u003cp\u003e\u003cstrong\u003eVersion Management\u003c/strong\u003e\u003cbr\u003eListing and installing Zig versions\u003c/p\u003e\r\n      \u003c/td\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg src=\"images/two.png\" width=\"300\" alt=\"Remote version listing\"\u003e\r\n        \u003cp\u003e\u003cstrong\u003eAvailable Versions\u003c/strong\u003e\u003cbr\u003eBrowsing installable Zig versions\u003c/p\u003e\r\n      \u003c/td\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg src=\"images/three.png\" width=\"300\" alt=\"Alias management\"\u003e\r\n        \u003cp\u003e\u003cstrong\u003eAlias Management\u003c/strong\u003e\u003cbr\u003eUsing aliases for version control\u003c/p\u003e\r\n      \u003c/td\u003e\r\n    \u003c/tr\u003e\r\n  \u003c/table\u003e\r\n\u003c/div\u003e\r\n\r\n## License\r\n\r\nMIT License - See [LICENSE](LICENSE) for details\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamitkewat%2Fzvm.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamitkewat%2Fzvm.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamitkewat%2Fzvm.js/lists"}