Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 23, 2019
1 parent 288fc10 commit 6faa054
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,4 +1,5 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
2 changes: 1 addition & 1 deletion index.d.ts
Expand Up @@ -16,7 +16,7 @@ The Node.js version will do a TCP handshake with the target's port. It attempts
The browser version is limited by the fact that browsers cannot connect to arbitrary ports. It only supports HTTP and HTTPS and the check relies on the `/favicon.ico` path being present.
@param targets - One or more targets to check. Can either be a full [URL](https://nodejs.org/api/url.html) like `https://hostname`, `hostname:port` or just `hostname`. When the protocol is missing from a target `http` is assumed. [Well-known protocols](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml) are supported (e.g. `ftp://`, `mysql://`, `redis://` and more).
@param targets - One or more targets to check. Can either be `hostname:port`, a URL like `https://hostname:port` or even just `hostname`. `port` must be specified if protocol is not `http:` or `https:` and defaults to `443`. Protocols other than `http:` and `https:` are not supported.
@returns Whether any of the `targets` are reachable.
@example
Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -43,14 +43,14 @@
"got": "^9.6.0",
"is-port-reachable": "^2.0.1",
"p-any": "^2.1.0",
"p-timeout": "^3.1.0",
"prepend-http": "^2.0.0",
"p-timeout": "^3.2.0",
"prepend-http": "^3.0.1",
"router-ips": "^1.0.0",
"url-parse": "^1.4.6"
"url-parse": "^1.4.7"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"ava": "^2.4.0",
"tsd": "^0.8.0",
"xo": "^0.24.0"
},
"browser": "browser.js"
Expand Down
9 changes: 1 addition & 8 deletions readme.md
Expand Up @@ -33,7 +33,7 @@ const isReachable = require('is-reachable');

## API

### isReachable(targets, [options])
### isReachable(targets, options?)

Returns a `Promise<boolean>` which is `true` if any of the `targets` are reachable.

Expand Down Expand Up @@ -64,10 +64,3 @@ Timeout in milliseconds after which a request is considered failed.

- [Sindre Sorhus](https://github.com/sindresorhus)
- [silverwind](https://github.com/silverwind)


## License

MIT

[Well-known protocols]: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml

0 comments on commit 6faa054

Please sign in to comment.