$53 GRAYBYTE WORDPRESS FILE MANAGER $95

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.149
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs24/root/usr/lib/node_modules/npm/lib/commands/

HOME
Current File : /opt/alt/alt-nodejs24/root/usr/lib/node_modules/npm/lib/commands//exec.js
const { resolve } = require('node:path')
const libexec = require('libnpmexec')
const BaseCommand = require('../base-cmd.js')

class Exec extends BaseCommand {
  static description = 'Run a command from a local or remote npm package'
  static params = [
    'package',
    'call',
    'workspace',
    'workspaces',
    'include-workspace-root',
  ]

  static name = 'exec'
  static usage = [
    '-- <pkg>[@<version>] [args...]',
    '--package=<pkg>[@<version>] -- <cmd> [args...]',
    '-c \'<cmd> [args...]\'',
    '--package=foo -c \'<cmd> [args...]\'',
  ]

  static workspaces = true
  static ignoreImplicitWorkspace = false
  static isShellout = true

  async exec (args) {
    return this.callExec(args)
  }

  async execWorkspaces (args) {
    await this.setWorkspaces()

    for (const [name, path] of this.workspaces) {
      const locationMsg =
        `in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}`
      await this.callExec(args, { name, locationMsg, runPath: path })
    }
  }

  async callExec (args, { name, locationMsg, runPath } = {}) {
    let localBin = this.npm.localBin
    let pkgPath = this.npm.localPrefix

    // This is where libnpmexec will actually run the scripts from
    if (!runPath) {
      runPath = process.cwd()
    } else {
      // We have to consider if the workspace has its own separate versions
      // libnpmexec will walk up to localDir after looking here
      localBin = resolve(this.npm.localDir, name, 'node_modules', '.bin')
      // We also need to look for `bin` entries in the workspace package.json
      // libnpmexec will NOT look in the project root for the bin entry
      pkgPath = runPath
    }

    const call = this.npm.config.get('call')
    let globalPath
    const {
      flatOptions,
      globalBin,
      globalDir,
      chalk,
    } = this.npm
    const scriptShell = this.npm.config.get('script-shell') || undefined
    const packages = this.npm.config.get('package')
    const yes = this.npm.config.get('yes')
    // --prefix sets both of these to the same thing, meaning the global prefix
    // is invalid (i.e. no lib/node_modules).  This is not a trivial thing to
    // untangle and fix so we work around it here.
    if (this.npm.localPrefix !== this.npm.globalPrefix) {
      globalPath = resolve(globalDir, '..')
    }

    if (call && args.length) {
      throw this.usageError()
    }

    return libexec({
      ...flatOptions,
      // we explicitly set packageLockOnly to false because if it's true
      // when we try to install a missing package, we won't actually install it
      packageLockOnly: false,
      // what the user asked to run args[0] is run by default
      args: [...args], // copy args so they don't get mutated
      // specify a custom command to be run instead of args[0]
      call,
      chalk,
      // where to look for bins globally, if a file matches call or args[0] it is called
      globalBin,
      // where to look for packages globally, if a package matches call or args[0] it is called
      globalPath,
      // where to look for bins locally, if a file matches call or args[0] it is called
      localBin,
      locationMsg,
      // packages that need to be installed
      packages,
      // path where node_modules is
      path: this.npm.localPrefix,
      // where to look for package.json#bin entries first
      pkgPath,
      // cwd to run from
      runPath,
      scriptShell,
      yes,
    })
  }
}

module.exports = Exec


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Apr 2026 8.48 AM
root / root
0755
access.js
6.165 KB
17 Mar 2026 12.21 PM
root / root
0644
adduser.js
1.29 KB
17 Mar 2026 12.21 PM
root / root
0644
audit.js
3.145 KB
17 Mar 2026 12.21 PM
root / root
0644
bugs.js
0.827 KB
17 Mar 2026 12.21 PM
root / root
0644
cache.js
11.521 KB
17 Mar 2026 12.21 PM
root / root
0644
ci.js
4.24 KB
17 Mar 2026 12.21 PM
root / root
0644
completion.js
8.904 KB
17 Mar 2026 12.21 PM
root / root
0644
config.js
11.492 KB
17 Mar 2026 12.21 PM
root / root
0644
dedupe.js
1.426 KB
17 Mar 2026 12.21 PM
root / root
0644
deprecate.js
2.43 KB
17 Mar 2026 12.21 PM
root / root
0644
diff.js
8.006 KB
17 Mar 2026 12.21 PM
root / root
0644
dist-tag.js
5.517 KB
17 Mar 2026 12.21 PM
root / root
0644
docs.js
0.438 KB
17 Mar 2026 12.21 PM
root / root
0644
doctor.js
10.06 KB
17 Mar 2026 12.21 PM
root / root
0644
edit.js
1.762 KB
17 Mar 2026 12.21 PM
root / root
0644
exec.js
3.419 KB
17 Mar 2026 12.21 PM
root / root
0644
explain.js
3.584 KB
17 Mar 2026 12.21 PM
root / root
0644
explore.js
2.159 KB
17 Mar 2026 12.21 PM
root / root
0644
find-dupes.js
0.619 KB
17 Mar 2026 12.21 PM
root / root
0644
fund.js
6.455 KB
17 Mar 2026 12.21 PM
root / root
0644
get.js
0.563 KB
17 Mar 2026 12.21 PM
root / root
0644
help-search.js
5.533 KB
17 Mar 2026 12.21 PM
root / root
0644
help.js
3.665 KB
17 Mar 2026 12.21 PM
root / root
0644
init.js
7.074 KB
17 Mar 2026 12.21 PM
root / root
0644
install-ci-test.js
0.364 KB
17 Mar 2026 12.21 PM
root / root
0644
install-test.js
0.361 KB
17 Mar 2026 12.21 PM
root / root
0644
install.js
5.12 KB
17 Mar 2026 12.21 PM
root / root
0644
link.js
5.271 KB
17 Mar 2026 12.21 PM
root / root
0644
ll.js
0.229 KB
17 Mar 2026 12.21 PM
root / root
0644
login.js
1.287 KB
17 Mar 2026 12.21 PM
root / root
0644
logout.js
1.419 KB
17 Mar 2026 12.21 PM
root / root
0644
ls.js
16.805 KB
17 Mar 2026 12.21 PM
root / root
0644
org.js
3.979 KB
17 Mar 2026 12.21 PM
root / root
0644
outdated.js
7.948 KB
17 Mar 2026 12.21 PM
root / root
0644
owner.js
5.951 KB
17 Mar 2026 12.21 PM
root / root
0644
pack.js
2.733 KB
17 Mar 2026 12.21 PM
root / root
0644
ping.js
0.853 KB
17 Mar 2026 12.21 PM
root / root
0644
pkg.js
3.599 KB
17 Mar 2026 12.21 PM
root / root
0644
prefix.js
0.302 KB
17 Mar 2026 12.21 PM
root / root
0644
profile.js
10.445 KB
17 Mar 2026 12.21 PM
root / root
0644
prune.js
0.78 KB
17 Mar 2026 12.21 PM
root / root
0644
publish.js
9.521 KB
17 Mar 2026 12.21 PM
root / root
0644
query.js
3.75 KB
17 Mar 2026 12.21 PM
root / root
0644
rebuild.js
2.188 KB
17 Mar 2026 12.21 PM
root / root
0644
repo.js
1.244 KB
17 Mar 2026 12.21 PM
root / root
0644
restart.js
0.296 KB
17 Mar 2026 12.21 PM
root / root
0644
root.js
0.288 KB
17 Mar 2026 12.21 PM
root / root
0644
run.js
6.266 KB
17 Mar 2026 12.21 PM
root / root
0644
sbom.js
4.484 KB
17 Mar 2026 12.21 PM
root / root
0644
search.js
1.833 KB
17 Mar 2026 12.21 PM
root / root
0644
set.js
0.655 KB
17 Mar 2026 12.21 PM
root / root
0644
shrinkwrap.js
2.648 KB
17 Mar 2026 12.21 PM
root / root
0644
star.js
1.875 KB
17 Mar 2026 12.21 PM
root / root
0644
stars.js
1.033 KB
17 Mar 2026 12.21 PM
root / root
0644
start.js
0.286 KB
17 Mar 2026 12.21 PM
root / root
0644
stop.js
0.281 KB
17 Mar 2026 12.21 PM
root / root
0644
team.js
4.356 KB
17 Mar 2026 12.21 PM
root / root
0644
test.js
0.281 KB
17 Mar 2026 12.21 PM
root / root
0644
token.js
7.962 KB
17 Mar 2026 12.21 PM
root / root
0644
undeprecate.js
0.295 KB
17 Mar 2026 12.21 PM
root / root
0644
uninstall.js
1.524 KB
17 Mar 2026 12.21 PM
root / root
0644
unpublish.js
5.401 KB
17 Mar 2026 12.21 PM
root / root
0644
unstar.js
0.179 KB
17 Mar 2026 12.21 PM
root / root
0644
update.js
1.737 KB
17 Mar 2026 12.21 PM
root / root
0644
version.js
3.536 KB
17 Mar 2026 12.21 PM
root / root
0644
view.js
13.58 KB
17 Mar 2026 12.21 PM
root / root
0644
whoami.js
0.515 KB
17 Mar 2026 12.21 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF