Skip to content

Commit

Permalink
README.md: document LinkCheckResult
Browse files Browse the repository at this point in the history
  • Loading branch information
tcort committed Jun 2, 2018
1 parent 7899ed7 commit c0b9971
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0b9971

Please sign in to comment.