$80 GRAYBYTE WORDPRESS FILE MANAGER $46

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/

HOME
Current File : /opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib//search.js
'use strict'

module.exports = exports = search

var npm = require('./npm.js')
var allPackageSearch = require('./search/all-package-search')
var esearch = require('./search/esearch.js')
var formatPackageStream = require('./search/format-package-stream.js')
var usage = require('./utils/usage')
var output = require('./utils/output.js')
var log = require('npmlog')
var ms = require('mississippi')

search.usage = usage(
  'search',
  'npm search [--long] [search terms ...]'
)

search.completion = function (opts, cb) {
  cb(null, [])
}

function search (args, cb) {
  var searchOpts = {
    description: npm.config.get('description'),
    exclude: prepareExcludes(npm.config.get('searchexclude')),
    include: prepareIncludes(args, npm.config.get('searchopts')),
    limit: npm.config.get('searchlimit'),
    log: log,
    staleness: npm.config.get('searchstaleness'),
    unicode: npm.config.get('unicode')
  }

  if (searchOpts.include.length === 0) {
    return cb(new Error('search must be called with arguments'))
  }

  // Used later to figure out whether we had any packages go out
  var anyOutput = false

  var entriesStream = ms.through.obj()

  var esearchWritten = false
  esearch(searchOpts).on('data', function (pkg) {
    entriesStream.write(pkg)
    !esearchWritten && (esearchWritten = true)
  }).on('error', function (e) {
    if (esearchWritten) {
      // If esearch errored after already starting output, we can't fall back.
      return entriesStream.emit('error', e)
    }
    log.warn('search', 'fast search endpoint errored. Using old search.')
    allPackageSearch(searchOpts).on('data', function (pkg) {
      entriesStream.write(pkg)
    }).on('error', function (e) {
      entriesStream.emit('error', e)
    }).on('end', function () {
      entriesStream.end()
    })
  }).on('end', function () {
    entriesStream.end()
  })

  // Grab a configured output stream that will spit out packages in the
  // desired format.
  var outputStream = formatPackageStream({
    args: args, // --searchinclude options are not highlighted
    long: npm.config.get('long'),
    description: npm.config.get('description'),
    json: npm.config.get('json'),
    parseable: npm.config.get('parseable'),
    color: npm.color
  })
  outputStream.on('data', function (chunk) {
    if (!anyOutput) { anyOutput = true }
    output(chunk.toString('utf8'))
  })

  log.silly('search', 'searching packages')
  ms.pipe(entriesStream, outputStream, function (er) {
    if (er) return cb(er)
    if (!anyOutput && !npm.config.get('json') && !npm.config.get('parseable')) {
      output('No matches found for ' + (args.map(JSON.stringify).join(' ')))
    }
    log.silly('search', 'search completed')
    log.clearProgress()
    cb(null, {})
  })
}

function prepareIncludes (args, searchopts) {
  if (typeof searchopts !== 'string') searchopts = ''
  return searchopts.split(/\s+/).concat(args).map(function (s) {
    return s.toLowerCase()
  }).filter(function (s) { return s })
}

function prepareExcludes (searchexclude) {
  var exclude
  if (typeof searchexclude === 'string') {
    exclude = searchexclude.split(/\s+/)
  } else {
    exclude = []
  }
  return exclude.map(function (s) {
    return s.toLowerCase()
  })
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 8.00 AM
root / root
0
auth
--
31 Aug 2024 8.02 AM
root / root
0755
config
--
31 Aug 2024 8.02 AM
root / root
0755
doctor
--
31 Aug 2024 8.02 AM
root / root
0755
install
--
31 Aug 2024 8.02 AM
root / root
0755
search
--
31 Aug 2024 8.02 AM
root / root
0755
utils
--
31 Aug 2024 8.02 AM
root / root
0755
access.js
3.234 KB
28 Sep 2021 6.28 PM
root / root
0644
adduser.js
1.283 KB
28 Sep 2021 6.28 PM
root / root
0644
bin.js
0.503 KB
28 Sep 2021 6.28 PM
root / root
0644
bugs.js
0.858 KB
28 Sep 2021 6.28 PM
root / root
0644
build.js
4.448 KB
28 Sep 2021 6.28 PM
root / root
0644
cache.js
4.433 KB
28 Sep 2021 6.28 PM
root / root
0644
completion.js
7.064 KB
28 Sep 2021 6.28 PM
root / root
0644
config.js
7.223 KB
28 Sep 2021 6.28 PM
root / root
0644
dedupe.js
4.831 KB
28 Sep 2021 6.28 PM
root / root
0644
deprecate.js
1.406 KB
28 Sep 2021 6.28 PM
root / root
0644
dist-tag.js
3.665 KB
28 Sep 2021 6.28 PM
root / root
0644
docs.js
1.055 KB
28 Sep 2021 6.28 PM
root / root
0644
doctor.js
3.974 KB
28 Sep 2021 6.28 PM
root / root
0644
edit.js
0.962 KB
28 Sep 2021 6.28 PM
root / root
0644
explore.js
1.633 KB
28 Sep 2021 6.28 PM
root / root
0644
fetch-package-metadata.js
3.798 KB
28 Sep 2021 6.28 PM
root / root
0644
fetch-package-metadata.md
1.767 KB
28 Sep 2021 6.28 PM
root / root
0644
get.js
0.229 KB
28 Sep 2021 6.28 PM
root / root
0644
help-search.js
5.65 KB
28 Sep 2021 6.28 PM
root / root
0644
help.js
6.321 KB
28 Sep 2021 6.28 PM
root / root
0644
init.js
1.261 KB
28 Sep 2021 6.28 PM
root / root
0644
install-test.js
0.495 KB
28 Sep 2021 6.28 PM
root / root
0644
install.js
32.159 KB
28 Sep 2021 6.28 PM
root / root
0644
link.js
5.561 KB
28 Sep 2021 6.28 PM
root / root
0644
logout.js
1.096 KB
28 Sep 2021 6.28 PM
root / root
0644
ls.js
15.833 KB
28 Sep 2021 6.28 PM
root / root
0644
npm.js
13.297 KB
28 Sep 2021 6.28 PM
root / root
0644
outdated.js
12.154 KB
28 Sep 2021 6.28 PM
root / root
0644
owner.js
7.547 KB
28 Sep 2021 6.28 PM
root / root
0644
pack.js
7.213 KB
28 Sep 2021 6.28 PM
root / root
0644
ping.js
0.672 KB
28 Sep 2021 6.28 PM
root / root
0644
prefix.js
0.322 KB
28 Sep 2021 6.28 PM
root / root
0644
profile.js
10.613 KB
28 Sep 2021 6.28 PM
root / root
0644
prune.js
2.145 KB
28 Sep 2021 6.28 PM
root / root
0644
publish.js
6.104 KB
28 Sep 2021 6.28 PM
root / root
0644
rebuild.js
2.093 KB
28 Sep 2021 6.28 PM
root / root
0644
repo.js
1.451 KB
28 Sep 2021 6.28 PM
root / root
0644
restart.js
0.063 KB
28 Sep 2021 6.28 PM
root / root
0644
root.js
0.309 KB
28 Sep 2021 6.28 PM
root / root
0644
run-script.js
5.179 KB
28 Sep 2021 6.28 PM
root / root
0644
search.js
3.152 KB
28 Sep 2021 6.28 PM
root / root
0644
set.js
0.27 KB
28 Sep 2021 6.28 PM
root / root
0644
shrinkwrap.js
7.764 KB
28 Sep 2021 6.28 PM
root / root
0644
star.js
1.174 KB
28 Sep 2021 6.28 PM
root / root
0644
stars.js
1.097 KB
28 Sep 2021 6.28 PM
root / root
0644
start.js
0.061 KB
28 Sep 2021 6.28 PM
root / root
0644
stop.js
0.06 KB
28 Sep 2021 6.28 PM
root / root
0644
substack.js
0.497 KB
28 Sep 2021 6.28 PM
root / root
0644
team.js
1.405 KB
28 Sep 2021 6.28 PM
root / root
0644
test.js
0.316 KB
28 Sep 2021 6.28 PM
root / root
0644
token.js
6.199 KB
28 Sep 2021 6.28 PM
root / root
0644
unbuild.js
4.112 KB
28 Sep 2021 6.28 PM
root / root
0644
uninstall.js
2.224 KB
28 Sep 2021 6.28 PM
root / root
0644
unpublish.js
3.553 KB
28 Sep 2021 6.28 PM
root / root
0644
update.js
2.185 KB
28 Sep 2021 6.28 PM
root / root
0644
version.js
9.104 KB
28 Sep 2021 6.28 PM
root / root
0644
view.js
9.264 KB
28 Sep 2021 6.28 PM
root / root
0644
visnup.js
4.008 KB
28 Sep 2021 6.28 PM
root / root
0644
whoami.js
1.421 KB
28 Sep 2021 6.28 PM
root / root
0644
xmas.js
1.571 KB
28 Sep 2021 6.28 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF