diff options
author | Aluneed <31174087+aluneed@users.noreply.github.com> | 2021-06-28 11:53:09 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-06-28 23:48:32 +0300 |
commit | 0dd0341ac9a65a2df8fc262ad9a56b7351f99d66 (patch) | |
tree | 793a6cc82f8611adc7781e21509a30377a152b43 | |
parent | 013f0262db3e16605820f6117749fd3ebc70f6d1 (diff) |
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
-rw-r--r-- | lib/ping.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ping.js b/lib/ping.js index 303793774..fbfb177ff 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'), |