{"name":"link-check","version":"4.3.4","description":"checks whether a hyperlink is alive (200 OK) or dead","main":"index.js","scripts":{"pretest":"jshint index.js","test":"mocha -R spec --exit"},"repository":{"type":"git","url":"git://github.com/tcort/link-check.git"},"keywords":["link","check","checker","hyperlink","alive","dead","HTTP","head"],"author":{"name":"Thomas Cort","email":"linuxgeek@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/tcort/link-check/issues"},"homepage":"https://github.com/tcort/link-check#readme","dependencies":{"is-relative-url":"^2.0.0","isemail":"^3.1.2","ms":"^2.1.1","request":"^2.85.0"},"devDependencies":{"expect.js":"^0.3.1","express":"^4.16.3","jshint":"^2.9.5","mocha":"^5.1.1"},"jshintConfig":{"bitwise":true,"curly":true,"eqeqeq":true,"forin":true,"freeze":true,"globalstrict":true,"immed":true,"indent":4,"moz":true,"newcap":true,"noarg":true,"node":true,"noempty":true,"nonew":true,"trailing":true,"undef":true,"smarttabs":true,"strict":true,"validthis":true,"globals":{"describe":false,"it":false,"before":false,"beforeEach":false,"after":false,"afterEach":false}},"gitHead":"b44836c018cbf9641161c75be567d5990c04d8eb","_id":"link-check@4.3.4","_npmVersion":"5.6.0","_nodeVersion":"4.8.4","_npmUser":{"name":"tcort","email":"linuxgeek@gmail.com"},"dist":{"integrity":"sha512-krGautMtIbUihr0fGQQptAZ1Zdpg6Stn3uylbj5ar7wXk3RGXOzLOUR8FmfsvtMbFVLpQyuFo3Gi0BNUV6GJ6A==","shasum":"e15af4676342f8044d0654e90065813323132499","tarball":"http://registry-npm.ywwl.com/link-check/download/link-check-4.3.4.tgz","fileCount":15,"unpackedSize":18696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4guBCRA9TVsSAnZWagAABRIP/2VR/ngyj4J1wdpE1sN2\ntJKFA//cWwDoPDkB4J6lD1Mu37gFy0ZwbTP67cf+Gaw6RIqH8280mS4huWun\nvOiBOgfUvG2xLYH4HUgjBWOTi9TiAtHmTomLpI7fcW3qLD3oTy9y7F41T4uz\nSuPFPB3cUmDgQhtPABVUWdj+QGgFUplo/G1IxGk1OR1RQJoXcQPKN9PC+ZZV\nxQ7pZ8ZzdWtfhvFx+ft8M63hOiaDlPP4F4YTEbqlrBjNlthoWO5GpJlH4WVY\nhqsbvtYw6wjONawUQBvwDbgFLXZVYd2x6FpHUfe11Igkk0XwW78NBr4wJob5\nTDufuIlZB0P81x+2TKhRjkNWQOtpeBvZ7vk5/seJm7pFuF7JWNj/t1TyC7Qy\nr/m7ic8LjpFaDZlv23uTEutHDspbeDTBkzC3HtgvprLeJGDK3ZaefXIRO02F\nJoH8gZ37/T9D49Co+41Xybcd1isxnnB+zh7/Edo239UxrVu8F+FFq+XRIr4Q\nAbsbC/A0ZYv+k7hFtHt3jOnhnookpL32eknU3bfLk6lE9ikdGrI/2KYUK+8I\nV6lzR0muNIIiDYg1EzTSt3EhaCAlCHwU6fT4dGg1qG0sAzfY+AObZ6gH8V0e\nMHAvMX65cNhoaGn5Iavtpe13OUCMDdvVs547qfZ0WLMC//J7mY2WoLR3xVEr\nJWe6\r\n=RdbE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICbQBovlPEYo23g5MCk0xRAVOtk8UpypqvnWzgCI7uMeAiAmRn7KiqyTNmxNlztV74kZ8e0T6+ZYyXwBgJymMNw2BA=="}],"size":5170,"noattachment":false,"key":"/link-check/-/link-check-4.3.4.tgz"},"maintainers":[{"name":"tcort","email":"linuxgeek@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/link-check_4.3.4_1524763520613_0.6027827686178091"},"_hasShrinkwrap":false,"readme":"![Test library workflow status](https://github.com/tcort/link-check/workflows/Test%20library/badge.svg)\n\n# link-check\n\nChecks whether a hyperlink is alive (`200 OK`) or dead.\n\n## Installation\n\n```console\nnpm install --save link-check\n```\n\n## Specification\n\nA link is said to be 'alive' if an HTTP HEAD or HTTP GET for the given URL\neventually ends in a `200 OK` response. To minimize bandwidth, an HTTP HEAD\nis performed. If that fails (e.g. with a `405 Method Not Allowed`), an HTTP\nGET is performed. Redirects are followed.\n\nIn the case of `mailto:` links, this module validates the e-mail address\nusing [isemail](https://www.npmjs.com/package/isemail).\n\n## API\n\n### linkCheck(link, [opts,] callback)\n\nGiven a `link` and a `callback`, attempt an HTTP HEAD and possibly an HTTP GET.\n\nParameters:\n\n* `url` string containing a URL.\n* `opts` optional options object containing any of the following optional fields:\n  * `anchors` array of anchor strings (e.g. `[ \"#foo\", \"#bar\" ]`) for checking anchor links (e.g. `<a href=\"#foo\">Foo</a>`).\n  * `baseUrl` the base URL for relative links.\n  * `timeout` timeout in [zeit/ms](https://www.npmjs.com/package/ms) format. (e.g. `\"2000ms\"`, `20s`, `1m`). Default `10s`.\n  * `user_agent` the user-agent string. Default `${name}/${version}` (e.g. `link-check/4.5.5`)\n  * `aliveStatusCodes` an array of numeric HTTP Response codes which indicate that the link is alive. Entries in this array may also be regular expressions. Example: `[ 200, /^[45][0-9]{2}$/ ]`.  Default `[ 200 ]`.\n  * `headers` a string based attribute value object to send custom HTTP headers. Example: `{ 'Authorization' : 'Basic Zm9vOmJhcg==' }`.\n  * `retryOn429` a boolean indicating whether to retry on a 429 (Too Many Requests) response. When true, if the response has a 429 HTTP code and includes an optional `retry-after` header, a retry will be attempted after the delay indicated in the `retry-after` header. If no `retry-after` header is present in the response or the `retry-after` header value is not valid according to [RFC7231](https://tools.ietf.org/html/rfc7231#section-7.1.3) (value must be in seconds), a default retry delay of 60 seconds will apply. This default can be overriden by the `fallbackRetryDelay` parameter.\n  * `retryCount` the number of retries to be made on a 429 response. Default `2`.\n  * `fallbackRetryDelay` the delay in [zeit/ms](https://www.npmjs.com/package/ms) format. (e.g. `\"2000ms\"`, `20s`, `1m`) for retries on a 429 response when no `retry-after` header is returned or when it has an invalid value. Default is `60s`.\n* `callback` function which accepts `(err, result)`.\n  * `err` an Error object when the operation cannot be completed, otherwise `null`.\n  * `result` an object with the following properties:\n    * `link` the `link` provided as input\n    * `status` a string set to either `alive` or `dead`.\n    * `statusCode` the HTTP status code. Set to `0` if no HTTP status code was returned (e.g. when the server is down).\n    * `err` any connection error that occurred, otherwise `null`.\n\n## Examples\n\n```js\n'use strict';\n\nconst linkCheck = require('link-check');\n\nlinkCheck('http://example.com', function (err, result) {\n    if (err) {\n        console.error(err);\n        return;\n    }\n    console.log(`${result.link} is ${result.status}`);\n});\n```\n\n**With basic authentication:**\n\n```js\n'use strict';\n\nconst linkCheck = require('link-check');\n\nlinkCheck('http://example.com', { headers: { 'Authorization': 'Basic Zm9vOmJhcg==' } }, function (err, result) {\n    if (err) {\n        console.error(err);\n        return;\n    }\n    console.log(`${result.link} is ${result.status}`);\n});\n```\n\n## Testing\n\n```console\nnpm test\n```\n\n## License\n\nSee [LICENSE.md](https://github.com/tcort/link-check/blob/master/LICENSE.md)\n","publish_time":1524763520693,"_cnpm_publish_time":1524763520693,"dist-tags":{"latest":"5.6.0"}}