Skip to content

Commit ab8396b

Browse files
chore: replace var with const in lib/adduser.js
1 parent 656bce7 commit ab8396b

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/adduser.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = adduser
22

3-
var log = require('npmlog')
4-
var npm = require('./npm.js')
5-
var usage = require('./utils/usage')
6-
var crypto
3+
const log = require('npmlog')
4+
const npm = require('./npm.js')
5+
const usage = require('./utils/usage')
6+
let crypto
77

88
try {
99
crypto = require('crypto')
@@ -21,20 +21,21 @@ function adduser (args, cb) {
2121
))
2222
}
2323

24-
var registry = npm.config.get('registry')
25-
var scope = npm.config.get('scope')
26-
var creds = npm.config.getCredentialsByURI(npm.config.get('registry'))
24+
const registry = npm.config.get('registry')
25+
const scope = npm.config.get('scope')
26+
const creds = npm.config.getCredentialsByURI(npm.config.get('registry'))
2727

2828
if (scope) {
29-
var scopedRegistry = npm.config.get(scope + ':registry')
30-
var cliRegistry = npm.config.get('registry', 'cli')
29+
const scopedRegistry = npm.config.get(scope + ':registry')
30+
const cliRegistry = npm.config.get('registry', 'cli')
3131
if (scopedRegistry && !cliRegistry) registry = scopedRegistry
3232
}
3333

3434
log.disableProgress()
3535

36+
let auth
3637
try {
37-
var auth = require('./auth/' + npm.config.get('auth-type'))
38+
auth = require('./auth/' + npm.config.get('auth-type'))
3839
} catch (e) {
3940
return cb(new Error('no such auth module'))
4041
}

0 commit comments

Comments
 (0)