Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../lib/node_mod.../npm/lib
File: docs.js
module.exports = docs
[0] Fix | Delete
[1] Fix | Delete
var openUrl = require('./utils/open-url')
[2] Fix | Delete
var log = require('npmlog')
[3] Fix | Delete
var fetchPackageMetadata = require('./fetch-package-metadata.js')
[4] Fix | Delete
var usage = require('./utils/usage')
[5] Fix | Delete
[6] Fix | Delete
docs.usage = usage(
[7] Fix | Delete
'docs',
[8] Fix | Delete
'npm docs <pkgname>' +
[9] Fix | Delete
'\nnpm docs .'
[10] Fix | Delete
)
[11] Fix | Delete
docs.completion = function (opts, cb) {
[12] Fix | Delete
// FIXME: there used to be registry completion here, but it stopped making
[13] Fix | Delete
// sense somewhere around 50,000 packages on the registry
[14] Fix | Delete
cb()
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
function docs (args, cb) {
[18] Fix | Delete
if (!args || !args.length) args = ['.']
[19] Fix | Delete
var pending = args.length
[20] Fix | Delete
log.silly('docs', args)
[21] Fix | Delete
args.forEach(function (proj) {
[22] Fix | Delete
getDoc(proj, function (err) {
[23] Fix | Delete
if (err) {
[24] Fix | Delete
return cb(err)
[25] Fix | Delete
}
[26] Fix | Delete
--pending || cb()
[27] Fix | Delete
})
[28] Fix | Delete
})
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
function getDoc (project, cb) {
[32] Fix | Delete
log.silly('getDoc', project)
[33] Fix | Delete
fetchPackageMetadata(project, '.', {fullMetadata: true}, function (er, d) {
[34] Fix | Delete
if (er) return cb(er)
[35] Fix | Delete
var url = d.homepage
[36] Fix | Delete
if (!url) url = 'https://www.npmjs.org/package/' + d.name
[37] Fix | Delete
return openUrl(url, 'docs available at the following URL', cb)
[38] Fix | Delete
})
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function