Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
whoami.js21 linesDownload Raw Back to commands
1const { output } = require('proc-log')
2const getIdentity = require('../utils/get-identity.js')
3const BaseCommand = require('../base-cmd.js')
4
5class Whoami extends BaseCommand {
6  static description = 'Display npm username'
7  static name = 'whoami'
8  static params = ['registry']
9
10  async exec () {
11    const username = await getIdentity(this.npm, { ...this.npm.flatOptions })
12    if (this.npm.config.get('json')) {
13      output.buffer(username)
14    } else {
15      output.standard(username)
16    }
17  }
18}
19
20module.exports = Whoami
21 
codekingpro/portable-devtools · Team Ai