From d0faf60898187cfd746ae2a69eacfbe13f622798 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Sat, 16 Dec 2023 14:35:07 +0100 Subject: [PATCH] feat: prefer bun over npm when available --- extension/asset_platform.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extension/asset_platform.go b/extension/asset_platform.go index ba6a01aa..9386a6b5 100644 --- a/extension/asset_platform.go +++ b/extension/asset_platform.go @@ -262,6 +262,11 @@ func getInstallCommand(path string) *exec.Cmd { return exec.Command("bun", "install") } + // Bun can migrate on the fly the package-lock.json to a bun.lockdb and is much faster than NPM + if _, err := exec.LookPath("bun"); err == nil { + return exec.Command("bun", "install", "--no-save") + } + return exec.Command("npm", "install", "--no-audit", "--no-fund", "--prefer-offline") }