Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: replace var with const in lib/adduser.js
  • Loading branch information
jamesgeorge007 committed Apr 23, 2019
commit 812d22560dd3f34d3bc06540529a2e6a39236a3b
21 changes: 11 additions & 10 deletions lib/adduser.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = adduser

var log = require('npmlog')
var npm = require('./npm.js')
var usage = require('./utils/usage')
var crypto
const log = require('npmlog')
const npm = require('./npm.js')
const usage = require('./utils/usage')
let crypto

try {
crypto = require('crypto')
Expand All @@ -21,20 +21,21 @@ function adduser (args, cb) {
))
}

var registry = npm.config.get('registry')
var scope = npm.config.get('scope')
var creds = npm.config.getCredentialsByURI(npm.config.get('registry'))
let registry = npm.config.get('registry')
const scope = npm.config.get('scope')
const creds = npm.config.getCredentialsByURI(npm.config.get('registry'))

if (scope) {
var scopedRegistry = npm.config.get(scope + ':registry')
var cliRegistry = npm.config.get('registry', 'cli')
const scopedRegistry = npm.config.get(scope + ':registry')
const cliRegistry = npm.config.get('registry', 'cli')
if (scopedRegistry && !cliRegistry) registry = scopedRegistry
}

log.disableProgress()

let auth
try {
var auth = require('./auth/' + npm.config.get('auth-type'))
auth = require('./auth/' + npm.config.get('auth-type'))
} catch (e) {
return cb(new Error('no such auth module'))
}
Expand Down