Server IP : 127.0.0.2 / Your IP : 52.14.154.79 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/npm/lib/ |
Upload File : |
var mapToRegistry = require('./utils/map-to-registry.js') var npm = require('./npm') module.exports = team team.subcommands = ['create', 'destroy', 'add', 'rm', 'ls', 'edit'] team.usage = 'npm team create <scope:team>\n' + 'npm team destroy <scope:team>\n' + 'npm team add <scope:team> <user>\n' + 'npm team rm <scope:team> <user>\n' + 'npm team ls <scope>|<scope:team>\n' + 'npm team edit <scope:team>' team.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length === 2) { return cb(null, team.subcommands) } switch (argv[2]) { case 'ls': case 'create': case 'destroy': case 'add': case 'rm': case 'edit': return cb(null, []) default: return cb(new Error(argv[2] + ' not recognized')) } } function team (args, cb) { // Entities are in the format <scope>:<team> var cmd = args.shift() var entity = (args.shift() || '').split(':') return mapToRegistry('/', npm.config, function (err, uri, auth) { if (err) { return cb(err) } try { return npm.registry.team(cmd, uri, { auth: auth, scope: entity[0], team: entity[1], user: args.shift() }, function (err, data) { !err && data && console.log(JSON.stringify(data, undefined, 2)) cb(err, data) }) } catch (e) { cb(e.message + '\n\nUsage:\n' + team.usage) } }) }