File Explorer

/var/lang/lib/node_modules/npm/lib/commands/stage

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

approve.js1.1 KB · 36 lines
const { log, output, META } = require('proc-log')const npmFetch = require('npm-registry-fetch')const { otplease } = require('../../utils/auth.js')const { validateUUID } = require('../../utils/validate-uuid.js')const BaseCommand = require('../../base-cmd.js') class StageApprove extends BaseCommand {  static description = 'Approve a staged package, publishing it to the npm registry'  static name = 'approve'  static usage = ['<stage-id>']  static params = ['otp', 'registry']  static positionals = 1   async exec (args) {    if (!args[0]) {      throw this.usageError('Missing required <stage-id>')    }    const stageId = args[0]    validateUUID(stageId, 'stage-id')    const opts = { ...this.npm.flatOptions }     log.notice('', `Approving staged package ${stageId}`)     await otplease(this.npm, opts, o =>      npmFetch.json(`/-/stage/${stageId}/approve`, {        ...o,        method: 'POST',      })    )     output.standard(`Staged package ${stageId} approved and published successfully.`, { [META]: true, redact: false })  }} module.exports = StageApprove