MCPcopy Create free account
hub / github.com/nodejs/node / exec

Method exec

deps/npm/lib/commands/stage/view.js:14–31  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

12 static positionals = 1
13
14 async exec (args) {
15 if (!args[0]) {
16 throw this.usageError('Missing required <stage-id>')
17 }
18 const stageId = args[0]
19 validateUUID(stageId, 'stage-id')
20 const opts = { ...this.npm.flatOptions }
21 const json = this.npm.config.get('json')
22
23 const item = await npmFetch.json(`/-/stage/${stageId}`, opts)
24
25 if (json) {
26 output.standard(JSON.stringify(item, null, 2), { [META]: true, redact: false })
27 return
28 }
29
30 logStageItem(item, { chalk: this.npm.chalk })
31 }
32}
33
34module.exports = StageView

Callers

nothing calls this directly

Calls 5

validateUUIDFunction · 0.85
logStageItemFunction · 0.85
usageErrorMethod · 0.80
getMethod · 0.65
jsonMethod · 0.65

Tested by

no test coverage detected