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

Method exec

deps/npm/lib/package-url-cmd.js:20–38  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

18 static usage = ['[<pkgname> [<pkgname> ...]]']
19
20 async exec (args) {
21 if (!args || !args.length) {
22 args = ['.']
23 }
24
25 for (const arg of args) {
26 // XXX It is very odd that `where` is how pacote knows to look anywhere other than the cwd.
27 const opts = {
28 ...this.npm.flatOptions,
29 where: this.npm.localPrefix,
30 fullMetadata: true,
31 _isRoot: true,
32 }
33 const mani = await pacote.manifest(arg, opts)
34 const url = this.getUrl(arg, mani)
35 log.silly(this.name, 'url', url)
36 await openUrl(this.npm, url, `${mani.name} ${this.name} available at the following URL`)
37 }
38 }
39
40 async execWorkspaces (args) {
41 if (args && args.length) {

Callers 1

execWorkspacesMethod · 0.95

Calls 2

openUrlFunction · 0.50
getUrlMethod · 0.45

Tested by

no test coverage detected