From 0dd0341ac9a65a2df8fc262ad9a56b7351f99d66 Mon Sep 17 00:00:00 2001 From: Aluneed <31174087+aluneed@users.noreply.github.com> Date: Mon, 28 Jun 2021 16:53:09 +0800 Subject: [PATCH] fix(ping): make "npm ping" echo a right time 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 PR-URL: https://github.com/npm/cli/pull/3474 Credit: @aluneed Close: #3474 Reviewed-by: @wraithgar --- lib/ping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ping.js b/lib/ping.js index 30379377482ec..fbfb177ff87fc 100644 --- a/lib/ping.js +++ b/lib/ping.js @@ -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'),