PATH: //opt/alt/alt-nodejs12/root/lib/node_modules/npm/lib
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 access.js
↓
X
📄 adduser.js
↓
X
📄 audit.js
↓
X
📁 auth/
X
📄 bin.js
↓
X
📄 bugs.js
↓
X
📄 build.js
↓
X
📄 cache.js
↓
X
📄 ci.js
↓
X
📄 completion.js
↓
X
📁 config/
X
📄 config.js
↓
X
📄 dedupe.js
↓
X
📄 deprecate.js
↓
X
📄 dist-tag.js
↓
X
📄 docs.js
↓
X
📁 doctor/
X
📄 doctor.js
↓
X
📄 edit.js
↓
X
📄 explore.js
↓
X
📄 fetch-package-metadata.js
↓
X
📄 fetch-package-metadata.md
↓
X
📄 fund.js
↓
X
📄 get.js
↓
X
📄 help-search.js
↓
X
📄 help.js
↓
X
📄 hook.js
↓
X
📄 init.js
↓
X
📁 install/
X
📄 install-ci-test.js
↓
X
📄 install-test.js
↓
X
📄 install.js
↓
X
📄 link.js
↓
X
📄 logout.js
↓
X
📄 ls.js
↓
X
📄 npm.js
↓
X
📄 org.js
↓
X
📄 outdated.js
↓
X
📄 owner.js
↓
X
📄 pack.js
↓
X
📄 ping.js
↓
X
📄 prefix.js
↓
X
📄 profile.js
↓
X
📄 prune.js
↓
X
📄 publish.js
↓
X
📄 rebuild.js
↓
X
📄 repo.js
↓
X
📄 restart.js
↓
X
📄 root.js
↓
X
📄 run-script.js
↓
X
📁 search/
X
📄 search.js
↓
X
📄 set.js
↓
X
📄 shrinkwrap.js
↓
X
📄 star.js
↓
X
📄 stars.js
↓
X
📄 start.js
↓
X
📄 stop.js
↓
X
📄 substack.js
↓
X
📄 team.js
↓
X
📄 test.js
↓
X
📄 token.js
↓
X
📄 unbuild.js
↓
X
📄 uninstall.js
↓
X
📄 unpublish.js
↓
X
📄 update.js
↓
X
📁 utils/
X
📄 version.js
↓
X
📄 view.js
↓
X
📄 visnup.js
↓
X
📄 whoami.js
↓
X
📄 xmas.js
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: deprecate.js
'use strict' const BB = require('bluebird') const npmConfig = require('./config/figgy-config.js') const fetch = require('libnpm/fetch') const figgyPudding = require('figgy-pudding') const otplease = require('./utils/otplease.js') const npa = require('libnpm/parse-arg') const semver = require('semver') const whoami = require('./whoami.js') const DeprecateConfig = figgyPudding({}) module.exports = deprecate deprecate.usage = 'npm deprecate <pkg>[@<version>] <message>' deprecate.completion = function (opts, cb) { return BB.try(() => { if (opts.conf.argv.remain.length > 2) { return } return whoami([], true, () => {}).then(username => { if (username) { // first, get a list of remote packages this user owns. // once we have a user account, then don't complete anything. // get the list of packages by user return fetch( `/-/by-user/${encodeURIComponent(username)}`, DeprecateConfig() ).then(list => list[username]) } }) }).nodeify(cb) } function deprecate ([pkg, msg], opts, cb) { if (typeof cb !== 'function') { cb = opts opts = null } opts = DeprecateConfig(opts || npmConfig()) return BB.try(() => { if (msg == null) throw new Error(`Usage: ${deprecate.usage}`) // fetch the data and make sure it exists. const p = npa(pkg) // npa makes the default spec "latest", but for deprecation // "*" is the appropriate default. const spec = p.rawSpec === '' ? '*' : p.fetchSpec if (semver.validRange(spec, true) === null) { throw new Error('invalid version range: ' + spec) } const uri = '/' + p.escapedName return fetch.json(uri, opts.concat({ spec: p, query: {write: true} })).then(packument => { // filter all the versions that match Object.keys(packument.versions) .filter(v => semver.satisfies(v, spec)) .forEach(v => { packument.versions[v].deprecated = msg }) return otplease(opts, opts => fetch(uri, opts.concat({ spec: p, method: 'PUT', body: packument, ignoreBody: true }))) }) }).nodeify(cb) }
SIMPAN PERUBAHAN