Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add ping command #5788

Closed
wants to merge 1 commit into from

4 participants

lib/ping.js
@@ -0,0 +1,21 @@
+
+var npm = require("./npm.js")
+
+module.exports = ping
+
+ping.usage = "npm ping"
+ping.usage = "\n"
+ping.usage = "ping registry"
@yorkie
yorkie added a note

how it does make sense? i guess using +=?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/ping.js
@@ -0,0 +1,21 @@
+
+var npm = require("./npm.js")
+
+module.exports = ping
+
+ping.usage = "npm ping"
+ping.usage = "\n"
@yorkie
yorkie added a note

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@michaelnisi

Sorry

@yorkie

Great :p

@othiym23
Owner

We haven't forgotten about this! We just need to get it together to land all the pieces and roll it out as a unit.

@michaelnisi
@iarna iarna added this to the 2.13.0 milestone
@zkat zkat referenced this pull request from a commit
@michaelnisi michaelnisi Add ping command
Fixes #5750

PR-URL: #5788
f1f7a85
@iarna iarna referenced this pull request from a commit
@michaelnisi michaelnisi npm: Add ping command
Fixes #5750

PR-URL: #5788
69e4c22
@iarna iarna referenced this pull request from a commit
@michaelnisi michaelnisi npm: Add ping command
Fixes #5750

PR-URL: #5788
311db70
@iarna
Owner

Landed in 2.x as f1f7a85

@iarna
Owner

Landed in master as 311db70

@iarna iarna closed this
@iarna iarna removed the review label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 23, 2014
  1. @michaelnisi

    Add ping command

    michaelnisi authored
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 0 deletions.
  1. +1 −0  lib/npm.js
  2. +19 −0 lib/ping.js
View
1  lib/npm.js
@@ -141,6 +141,7 @@ var commandCache = {}
, "prefix"
, "bin"
, "whoami"
+ , "ping"
, "test"
, "stop"
View
19 lib/ping.js
@@ -0,0 +1,19 @@
+
+var npm = require("./npm.js")
+
+module.exports = ping
+
+ping.usage = "npm ping\nping registry"
+
+function ping (args, silent, cb) {
+ if (typeof cb !== "function") {
+ cb = silent
+ silent = false
+ }
+ var registry = npm.config.get("registry")
+ if (!registry) return cb(new Error("no default registry set"))
+
+ npm.registry.ping(registry, function (er, pong) {
+ cb(er, er ? null : pong)
+ })
+}
Something went wrong with that request. Please try again.