MCPcopy Create free account
hub / github.com/npm/cli / rm

Method rm

lib/commands/org.js:87–116  ·  view source on GitHub ↗
(org, user, opts)

Source from the content-addressed store, hash-verified

85 }
86
87 async rm (org, user, opts) {
88 if (!org) {
89 throw new Error('First argument `orgname` is required.')
90 }
91
92 if (!user) {
93 throw new Error('Second argument `username` is required.')
94 }
95
96 await liborg.rm(org, user, opts)
97 const roster = await liborg.ls(org, opts)
98 user = user.replace(/^[~@]?/, '')
99 org = org.replace(/^[~@]?/, '')
100 const userCount = Object.keys(roster).length
101 if (opts.json) {
102 output.buffer({
103 user,
104 org,
105 userCount,
106 deleted: true,
107 })
108 } else if (opts.parseable) {
109 output.standard(['user', 'org', 'userCount', 'deleted'].join('\t'))
110 output.standard([user, org, userCount, true].join('\t'))
111 } else if (!this.npm.silent) {
112 output.standard(
113 `Successfully removed ${user} from ${org}. You now have ${userCount} member${userCount === 1 ? '' : 's'} in this org.`
114 )
115 }
116 }
117
118 async ls (org, user, opts) {
119 if (!org) {

Callers 14

execMethod · 0.95
npmInstallFunction · 0.45
#cleanLogsMethod · 0.45
cleanMethod · 0.45
npxRmMethod · 0.45
execMethod · 0.45
reify.jsFile · 0.45
index.jsFile · 0.45
index.jsFile · 0.45
setupFunction · 0.45
log-file.jsFile · 0.45

Calls 2

replaceMethod · 0.80
lsMethod · 0.45

Tested by

no test coverage detected