MCPcopy
hub / github.com/Eugeny/tabby / ensureLoaded

Method ensureLoaded

app/lib/pluginManager.ts:8–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 npmReady?: Promise<void>
7
8 async ensureLoaded (): Promise<void> {
9 if (!this.npmReady) {
10 this.npmReady = new Promise(resolve => {
11 const npm = require('npm')
12 npm.load(err => {
13 if (err) {
14 console.error(err)
15 return
16 }
17 npm.config.set('global', false)
18 this.npm = npm
19 resolve()
20 })
21 })
22 }
23 return this.npmReady
24 }
25
26 async install (path: string, name: string, version: string): Promise<void> {
27 await this.ensureLoaded()

Callers 2

installMethod · 0.95
uninstallMethod · 0.95

Calls 3

errorMethod · 0.80
setMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected