From afeebd818d2ddf2167f8e26a97c22090474ad53a Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Mon, 16 Mar 2026 14:41:59 +0800 Subject: [PATCH] docs: update README to include Bun configuration for Xget mirror --- README.md | 28 ++++++++++++++++++++++------ README.zh-Hans.md | 28 ++++++++++++++++++++++------ README.zh-Hant.md | 28 ++++++++++++++++++++++------ 3 files changed, 66 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4766d4d..ee2089d 100644 --- a/README.md +++ b/README.md @@ -1089,18 +1089,34 @@ npm config set registry https://xget.xi-xu.me/npm/ npm config get registry ``` -#### Use in Project +#### Configure Bun to Use Xget Mirror + +```toml +# bunfig.toml (project-level) or ~/.bunfig.toml (global) +[install] +registry = "https://xget.xi-xu.me/npm/" +``` ```bash -# Configure project-level mirror in .npmrc file +# Install dependencies with Bun +bun install + +# Bun also supports .npmrc, so you can reuse existing npm registry settings +echo "registry=https://xget.xi-xu.me/npm/" > .npmrc +bun install +``` + +#### Use in Project (npm / Bun) + +```bash +# Configure project-level mirror in .npmrc (.npmrc can be reused by npm / Bun) echo "registry=https://xget.xi-xu.me/npm/" > .npmrc -# Install dependencies +# Install dependencies with npm npm install -# Or use yarn -yarn config set registry https://xget.xi-xu.me/npm/ -yarn install +# Install dependencies with Bun +bun install ``` ### Python Package Acceleration diff --git a/README.zh-Hans.md b/README.zh-Hans.md index c0ebb56..cfef2d4 100644 --- a/README.zh-Hans.md +++ b/README.zh-Hans.md @@ -1052,18 +1052,34 @@ npm config set registry https://xget.xi-xu.me/npm/ npm config get registry ``` -#### 在项目中使用 +#### 配置 Bun 使用 Xget 镜像 + +```toml +# bunfig.toml(项目级)或 ~/.bunfig.toml(全局) +[install] +registry = "https://xget.xi-xu.me/npm/" +``` ```bash -# 在 .npmrc 文件中配置项目级镜像 +# 使用 Bun 安装依赖 +bun install + +# Bun 也支持 .npmrc,可直接复用已有的 npm 镜像配置 +echo "registry=https://xget.xi-xu.me/npm/" > .npmrc +bun install +``` + +#### 在项目中使用(npm / Bun) + +```bash +# 在 .npmrc 文件中配置项目级镜像(npm / Bun 可复用) echo "registry=https://xget.xi-xu.me/npm/" > .npmrc -# 安装依赖 +# 使用 npm 安装依赖 npm install -# 或者使用 yarn -yarn config set registry https://xget.xi-xu.me/npm/ -yarn install +# 使用 Bun 安装依赖 +bun install ``` ### Python 包管理加速 diff --git a/README.zh-Hant.md b/README.zh-Hant.md index e98a730..8d4d431 100644 --- a/README.zh-Hant.md +++ b/README.zh-Hant.md @@ -1052,18 +1052,34 @@ npm config set registry https://xget.xi-xu.me/npm/ npm config get registry ``` -#### 在專案中使用 +#### 配置 Bun 使用 Xget 鏡像 + +```toml +# bunfig.toml(專案級)或 ~/.bunfig.toml(全域) +[install] +registry = "https://xget.xi-xu.me/npm/" +``` ```bash -# 在 .npmrc 檔案中配置專案級鏡像 +# 使用 Bun 安裝依賴項 +bun install + +# Bun 也支援 .npmrc,可直接重用既有的 npm 鏡像配置 +echo "registry=https://xget.xi-xu.me/npm/" > .npmrc +bun install +``` + +#### 在專案中使用(npm / Bun) + +```bash +# 在 .npmrc 檔案中配置專案級鏡像(npm / Bun 可重用) echo "registry=https://xget.xi-xu.me/npm/" > .npmrc -# 安裝依賴項 +# 使用 npm 安裝依賴項 npm install -# 或者使用 yarn -yarn config set registry https://xget.xi-xu.me/npm/ -yarn install +# 使用 Bun 安裝依賴項 +bun install ``` ### Python 軟體包管理加速