MCPcopy Index your code
hub / github.com/nodejs/node / execWorkspaces

Method execWorkspaces

deps/npm/lib/commands/view.js:72–99  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

70 }
71
72 async execWorkspaces (args) {
73 const { pkg, local, rest } = parseArgs(args)
74
75 if (!local) {
76 log.warn('Ignoring workspaces for specified package(s)')
77 return this.exec([pkg, ...rest])
78 }
79
80 const json = this.npm.config.get('json')
81 await this.setWorkspaces()
82
83 for (const name of this.workspaceNames) {
84 try {
85 await this.#viewPackage(`${name}${pkg.slice(1)}`, rest, { workspace: true })
86 } catch (e) {
87 const err = getError(e, { npm: this.npm, command: this })
88 if (err.code !== 'E404') {
89 throw e
90 }
91 if (json) {
92 output.buffer({ [META]: true, jsonError: { [name]: jsonError(err, this.npm) } })
93 } else {
94 outputError(err)
95 }
96 process.exitCode = err.exitCode
97 }
98 }
99 }
100
101 async #viewPackage (name, args, { workspace } = {}) {
102 const wholePackument = !args.length

Callers

nothing calls this directly

Calls 11

execMethod · 0.95
#viewPackageMethod · 0.95
jsonErrorFunction · 0.85
outputErrorFunction · 0.85
warnMethod · 0.80
setWorkspacesMethod · 0.80
parseArgsFunction · 0.70
getMethod · 0.65
sliceMethod · 0.65
getErrorFunction · 0.50
bufferMethod · 0.45

Tested by

no test coverage detected