GRAYBYTE WORDPRESS FILE MANAGER9497

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/lib/node_modules/npm/lib/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/lib/node_modules/npm/lib//completion.js
module.exports = completion

completion.usage = 'source <(npm completion)'

var npm = require('./npm.js')
var npmconf = require('./config/core.js')
var configDefs = npmconf.defs
var configTypes = configDefs.types
var shorthands = configDefs.shorthands
var nopt = require('nopt')
var configNames = Object.keys(configTypes)
  .filter(function (e) { return e.charAt(0) !== '_' })
var shorthandNames = Object.keys(shorthands)
var allConfs = configNames.concat(shorthandNames)
var once = require('once')
var isWindowsShell = require('./utils/is-windows-shell.js')
var output = require('./utils/output.js')

completion.completion = function (opts, cb) {
  if (opts.w > 3) return cb()

  var fs = require('graceful-fs')
  var path = require('path')
  var bashExists = null
  var zshExists = null
  fs.stat(path.resolve(process.env.HOME, '.bashrc'), function (er) {
    bashExists = !er
    next()
  })
  fs.stat(path.resolve(process.env.HOME, '.zshrc'), function (er) {
    zshExists = !er
    next()
  })
  function next () {
    if (zshExists === null || bashExists === null) return
    var out = []
    if (zshExists) out.push('~/.zshrc')
    if (bashExists) out.push('~/.bashrc')
    if (opts.w === 2) {
      out = out.map(function (m) {
        return ['>>', m]
      })
    }
    cb(null, out)
  }
}

function completion (args, cb) {
  if (isWindowsShell) {
    var e = new Error('npm completion supported only in MINGW / Git bash on Windows')
    e.code = 'ENOTSUP'
    e.errno = require('constants').ENOTSUP // eslint-disable-line node/no-deprecated-api
    return cb(e)
  }

  // if the COMP_* isn't in the env, then just dump the script.
  if (process.env.COMP_CWORD === undefined ||
      process.env.COMP_LINE === undefined ||
      process.env.COMP_POINT === undefined) {
    return dumpScript(cb)
  }

  console.error(process.env.COMP_CWORD)
  console.error(process.env.COMP_LINE)
  console.error(process.env.COMP_POINT)

  // get the partial line and partial word,
  // if the point isn't at the end.
  // ie, tabbing at: npm foo b|ar
  var w = +process.env.COMP_CWORD
  var words = args.map(unescape)
  var word = words[w]
  var line = process.env.COMP_LINE
  var point = +process.env.COMP_POINT
  var partialLine = line.substr(0, point)
  var partialWords = words.slice(0, w)

  // figure out where in that last word the point is.
  var partialWord = args[w]
  var i = partialWord.length
  while (partialWord.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) {
    i--
  }
  partialWord = unescape(partialWord.substr(0, i))
  partialWords.push(partialWord)

  var opts = {
    words: words,
    w: w,
    word: word,
    line: line,
    lineLength: line.length,
    point: point,
    partialLine: partialLine,
    partialWords: partialWords,
    partialWord: partialWord,
    raw: args
  }

  cb = wrapCb(cb, opts)

  console.error(opts)

  if (partialWords.slice(0, -1).indexOf('--') === -1) {
    if (word.charAt(0) === '-') return configCompl(opts, cb)
    if (words[w - 1] &&
        words[w - 1].charAt(0) === '-' &&
        !isFlag(words[w - 1])) {
      // awaiting a value for a non-bool config.
      // don't even try to do this for now
      console.error('configValueCompl')
      return configValueCompl(opts, cb)
    }
  }

  // try to find the npm command.
  // it's the first thing after all the configs.
  // take a little shortcut and use npm's arg parsing logic.
  // don't have to worry about the last arg being implicitly
  // boolean'ed, since the last block will catch that.
  var parsed = opts.conf =
    nopt(configTypes, shorthands, partialWords.slice(0, -1), 0)
  // check if there's a command already.
  console.error(parsed)
  var cmd = parsed.argv.remain[1]
  if (!cmd) return cmdCompl(opts, cb)

  Object.keys(parsed).forEach(function (k) {
    npm.config.set(k, parsed[k])
  })

  // at this point, if words[1] is some kind of npm command,
  // then complete on it.
  // otherwise, do nothing
  cmd = npm.commands[cmd]
  if (cmd && cmd.completion) return cmd.completion(opts, cb)

  // nothing to do.
  cb()
}

function dumpScript (cb) {
  var fs = require('graceful-fs')
  var path = require('path')
  var p = path.resolve(__dirname, 'utils/completion.sh')

  // The Darwin patch below results in callbacks first for the write and then
  // for the error handler, so make sure we only call our callback once.
  cb = once(cb)

  fs.readFile(p, 'utf8', function (er, d) {
    if (er) return cb(er)
    d = d.replace(/^#!.*?\n/, '')

    process.stdout.write(d, function () { cb() })
    process.stdout.on('error', function (er) {
      // Darwin is a pain sometimes.
      //
      // This is necessary because the "source" or "." program in
      // bash on OS X closes its file argument before reading
      // from it, meaning that you get exactly 1 write, which will
      // work most of the time, and will always raise an EPIPE.
      //
      // Really, one should not be tossing away EPIPE errors, or any
      // errors, so casually.  But, without this, `. <(npm completion)`
      // can never ever work on OS X.
      if (er.errno === 'EPIPE') er = null
      cb(er)
    })
  })
}

function unescape (w) {
  if (w.charAt(0) === '\'') return w.replace(/^'|'$/g, '')
  else return w.replace(/\\ /g, ' ')
}

function escape (w) {
  if (!w.match(/\s+/)) return w
  return '\'' + w + '\''
}

// The command should respond with an array.  Loop over that,
// wrapping quotes around any that have spaces, and writing
// them to stdout.  Use console.log, not the outfd config.
// If any of the items are arrays, then join them with a space.
// Ie, returning ['a', 'b c', ['d', 'e']] would allow it to expand
// to: 'a', 'b c', or 'd' 'e'
function wrapCb (cb, opts) {
  return function (er, compls) {
    if (!Array.isArray(compls)) compls = compls ? [compls] : []
    compls = compls.map(function (c) {
      if (Array.isArray(c)) c = c.map(escape).join(' ')
      else c = escape(c)
      return c
    })

    if (opts.partialWord) {
      compls = compls.filter(function (c) {
        return c.indexOf(opts.partialWord) === 0
      })
    }

    console.error([er && er.stack, compls, opts.partialWord])
    if (er || compls.length === 0) return cb(er)

    output(compls.join('\n'))
    cb()
  }
}

// the current word has a dash.  Return the config names,
// with the same number of dashes as the current word has.
function configCompl (opts, cb) {
  var word = opts.word
  var split = word.match(/^(-+)((?:no-)*)(.*)$/)
  var dashes = split[1]
  var no = split[2]
  var flags = configNames.filter(isFlag)
  console.error(flags)

  return cb(null, allConfs.map(function (c) {
    return dashes + c
  }).concat(flags.map(function (f) {
    return dashes + (no || 'no-') + f
  })))
}

// expand with the valid values of various config values.
// not yet implemented.
function configValueCompl (opts, cb) {
  console.error('configValue', opts)
  return cb(null, [])
}

// check if the thing is a flag or not.
function isFlag (word) {
  // shorthands never take args.
  var split = word.match(/^(-*)((?:no-)+)?(.*)$/)
  var no = split[2]
  var conf = split[3]
  return no || configTypes[conf] === Boolean || shorthands[conf]
}

// complete against the npm commands
function cmdCompl (opts, cb) {
  return cb(null, npm.fullList)
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
January 01 1970 00:00:00
root / root
0
auth
--
March 03 2024 22:36:29
root / root
0755
config
--
March 03 2024 22:36:29
root / root
0755
doctor
--
March 03 2024 22:36:29
root / root
0755
install
--
March 03 2024 22:36:29
root / root
0755
search
--
March 03 2024 22:36:29
root / root
0755
utils
--
March 03 2024 22:36:29
root / root
0755
access.js
5.539 KB
March 10 2021 14:36:36
root / root
0644
adduser.js
1.306 KB
March 10 2021 14:36:36
root / root
0644
audit.js
10.558 KB
March 10 2021 14:36:36
root / root
0644
bin.js
0.503 KB
March 10 2021 14:36:36
root / root
0644
bugs.js
0.844 KB
March 10 2021 14:36:35
root / root
0644
build.js
4.438 KB
March 10 2021 14:36:36
root / root
0644
cache.js
4.661 KB
March 10 2021 14:36:36
root / root
0644
ci.js
1.31 KB
March 10 2021 14:36:36
root / root
0644
completion.js
7.107 KB
March 10 2021 14:36:36
root / root
0644
config.js
7.434 KB
March 10 2021 14:36:36
root / root
0644
dedupe.js
4.882 KB
March 10 2021 14:36:35
root / root
0644
deprecate.js
2.106 KB
March 10 2021 14:36:35
root / root
0644
dist-tag.js
4.105 KB
March 10 2021 14:36:36
root / root
0644
docs.js
1.038 KB
March 10 2021 14:36:36
root / root
0644
doctor.js
3.979 KB
March 10 2021 14:36:35
root / root
0644
edit.js
1.374 KB
March 10 2021 14:36:36
root / root
0644
explore.js
1.669 KB
March 10 2021 14:36:36
root / root
0644
fetch-package-metadata.js
3.969 KB
March 10 2021 14:36:36
root / root
0644
fetch-package-metadata.md
1.769 KB
March 10 2021 14:36:36
root / root
0644
fund.js
4.908 KB
March 10 2021 14:36:36
root / root
0644
get.js
0.229 KB
March 10 2021 14:36:36
root / root
0644
help-search.js
5.642 KB
March 10 2021 14:36:36
root / root
0644
help.js
6.354 KB
March 10 2021 14:36:36
root / root
0644
hook.js
4.616 KB
March 10 2021 14:36:35
root / root
0644
init.js
2.739 KB
March 10 2021 14:36:36
root / root
0644
install-ci-test.js
0.475 KB
March 10 2021 14:36:36
root / root
0644
install-test.js
0.495 KB
March 10 2021 14:36:36
root / root
0644
install.js
36.47 KB
March 10 2021 14:36:36
root / root
0644
link.js
5.604 KB
March 10 2021 14:36:36
root / root
0644
logout.js
1.259 KB
March 10 2021 14:36:36
root / root
0644
ls.js
16.094 KB
March 10 2021 14:36:36
root / root
0644
npm.js
14.374 KB
March 10 2021 14:36:36
root / root
0644
org.js
4.176 KB
March 10 2021 14:36:36
root / root
0644
outdated.js
12.277 KB
March 10 2021 14:36:35
root / root
0644
owner.js
6.596 KB
March 10 2021 14:36:36
root / root
0644
pack.js
11.785 KB
March 10 2021 14:36:36
root / root
0644
ping.js
1.114 KB
March 10 2021 14:36:36
root / root
0644
prefix.js
0.322 KB
March 10 2021 14:36:36
root / root
0644
profile.js
11.134 KB
March 10 2021 14:36:36
root / root
0644
prune.js
2.228 KB
March 10 2021 14:36:36
root / root
0644
publish.js
5.141 KB
March 10 2021 14:36:36
root / root
0644
rebuild.js
2.093 KB
March 10 2021 14:36:36
root / root
0644
repo.js
1.437 KB
March 10 2021 14:36:35
root / root
0644
restart.js
0.063 KB
March 10 2021 14:36:36
root / root
0644
root.js
0.313 KB
March 10 2021 14:36:35
root / root
0644
run-script.js
5.41 KB
March 10 2021 14:36:36
root / root
0644
search.js
3.361 KB
March 10 2021 14:36:36
root / root
0644
set.js
0.27 KB
March 10 2021 14:36:36
root / root
0644
shrinkwrap.js
9.82 KB
March 10 2021 14:36:36
root / root
0644
star.js
2.106 KB
March 10 2021 14:36:36
root / root
0644
stars.js
1.029 KB
March 10 2021 14:36:36
root / root
0644
start.js
0.061 KB
March 10 2021 14:36:36
root / root
0644
stop.js
0.06 KB
March 10 2021 14:36:36
root / root
0644
substack.js
0.497 KB
March 10 2021 14:36:36
root / root
0644
team.js
4.613 KB
March 10 2021 14:36:36
root / root
0644
test.js
0.365 KB
March 10 2021 14:36:36
root / root
0644
token.js
6.658 KB
March 10 2021 14:36:36
root / root
0644
unbuild.js
4.271 KB
March 10 2021 14:36:36
root / root
0644
uninstall.js
2.208 KB
March 10 2021 14:36:35
root / root
0644
unpublish.js
3.51 KB
March 10 2021 14:36:36
root / root
0644
update.js
2.161 KB
March 10 2021 14:36:36
root / root
0644
version.js
9.794 KB
March 10 2021 14:36:36
root / root
0644
view.js
15.11 KB
March 10 2021 14:36:36
root / root
0644
visnup.js
4.008 KB
March 10 2021 14:36:35
root / root
0644
whoami.js
1.767 KB
March 10 2021 14:36:36
root / root
0644
xmas.js
1.624 KB
March 10 2021 14:36:35
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF