forked from tcort/link-check
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,19 @@ Parameters: | |
* `statusCode` the HTTP status code. Set to `0` if no HTTP status code was returned (e.g. when the server is down). | ||
* `err` any connection error that occurred, otherwise `null`. | ||
|
||
### LinkCheckResult(link, statusCode, err) | ||
|
||
If you need the `LinkCheckResult` class to make your own results or to compare an object | ||
to it with `instanceof`, the class is exposed` via `require('link-check').LinkCheckResult`. | ||
|
||
Parameters: | ||
|
||
* `link` a string representing the link (e.g. `http://example.org`, `mailto:[email protected]`, etc) | ||
* `statusCode` a numeric code that corresponds to an HTTP status code or 0 if there is no code due to a problem. | ||
* `err` an Error object detailing the problem (if applicable). | ||
|
||
The resulting object has the above properties as well as `status` which is either `'dead'` or `'alive'`. | ||
|
||
## Examples | ||
|
||
```js | ||
|