MCPcopy Create free account
hub / github.com/angular/dev-infra / logout

Function logout

ng-dev/release/versioning/npm-command.ts:162–175  ·  view source on GitHub ↗

* Log out of NPM at a provided registry. * @returns Whether the user was logged out of NPM.

(registryUrl: string | undefined)

Source from the content-addressed store, hash-verified

160 return true;
161 }
162
163 /**
164 * Log into NPM at a provided registry using an interactive invocation.
165 * @throws With the `npm login` status code if the login failed.
166 */
167 static async startInteractiveLogin(registryUrl: string | undefined) {
168 const args = ['login', '--no-browser'];
169 // If a custom registry URL has been specified, add the `--registry` flag. The `--registry` flag
170 // must be spliced into the correct place in the command as npm expects it to be the flag
171 // immediately following the login subcommand.
172 if (registryUrl !== undefined) {
173 args.splice(1, 0, '--registry', registryUrl);
174 }
175 // The login command prompts for username, password and other profile information. Hence
176 // the process needs to be interactive (i.e. respecting current TTYs stdin).
177 await ChildProcess.spawnInteractive('npm', args);
178 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected