MCPcopy
hub / github.com/vitest-dev/vitest / installPackages

Function installPackages

packages/vitest/src/create/browser/creator.ts:153–164  ·  view source on GitHub ↗
(pkgManager: string | null, packages: string[])

Source from the content-addressed store, hash-verified

151}
152
153async function installPackages(pkgManager: string | null, packages: string[]) {
154 if (!packages.length) {
155 log(c.green('✔'), c.bold('All packages are already installed.'))
156 return
157 }
158
159 log(c.cyan('◼'), c.bold('Installing packages...'))
160 log(c.cyan('◼'), packages.join(', '))
161
162 log()
163 await installPackage(packages, { dev: true, packageManager: pkgManager ?? undefined })
164}
165
166function readPkgJson(path: string) {
167 if (!existsSync(path)) {

Callers 1

createFunction · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected