Skip to content

Commit

Permalink
fix(ping): make "npm ping" echo a right time
Browse files Browse the repository at this point in the history
There is no need to make the time divided by 1000 because of the time unit 'ms'. 
Currently a typical command and response:
PS C:\projects> npm ping
npm notice PING http://registry.npmjs.org/
npm notice PONG 0.752ms
  • Loading branch information
aluneed authored Jun 28, 2021
1 parent cf55fe0 commit b7e4c92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Ping extends BaseCommand {
const start = Date.now()
const details = await pingUtil(this.npm.flatOptions)
const time = Date.now() - start
log.notice('PONG', `${time / 1000}ms`)
log.notice('PONG', `${time}ms`)
if (this.npm.config.get('json')) {
this.npm.output(JSON.stringify({
registry: this.npm.config.get('registry'),
Expand Down

0 comments on commit b7e4c92

Please sign in to comment.