MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / runNpmLogin

Function runNpmLogin

cli/src/cli.ts:17–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15const DEV_FRONTEND_URL = 'http://127.0.0.1:3000/'
16
17async function runNpmLogin(): Promise<boolean> {
18 const { command, args } = resolveNpmProcessCommand(['login', `--registry=${NPM_REGISTRY_URL}`])
19 const child = spawn(command, args, { stdio: 'inherit' })
20
21 const { promise, resolve } = Promise.withResolvers<boolean>()
22
23 child.on('close', code => {
24 resolve(code === 0)
25 })
26
27 child.on('error', () => {
28 resolve(false)
29 })
30
31 return promise
32}
33
34const main = defineCommand({
35 meta: {

Callers 1

runFunction · 0.85

Calls 1

resolveNpmProcessCommandFunction · 0.90

Tested by

no test coverage detected