Permalink
Browse files

updated readme with npm

  • Loading branch information...
1 parent 2cdf9b6 commit e7094988ab8c3c0115c7d326ad05d4ac063bd852 @danielzzz committed Nov 23, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 README
View
10 README
@@ -9,6 +9,9 @@ DESCRIPTION
This library allows for easy and simple tcp port checking.
It can be used for determining if a given port is open, or to find a first available port
+INSTALLATION:
+npm install portchecker
+
API:
getFirstAvailable(startPort, endPort, host, cb)
returns first available port in a given range cb(port, host)
@@ -19,10 +22,13 @@ returns array of available ports for a given hosts in a given range cb(openPorts
isOpen(port, host, callback)
returns true if a given host:port is open cb(isOpen, port, host)
+setTimeout(milisecs)
+configure timeout for port probing (default 400 milisecs)
+
EXAMPLE:
-//find first available port between 80 and 8090 on localhost
-portchecker.getFirstAvailable(80, 8090, 'localhost', function(p, host) { console.log(host+":"+p+" is free");});
+//find first available port between 80 and 90 on localhost
+portchecker.getFirstAvailable(80, 90, 'localhost', function(p, host) { console.log(host+":"+p+" is free");});

0 comments on commit e709498

Please sign in to comment.