[
  {
    "__docId__": 1,
    "kind": "external",
    "name": "Infinity",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Infinity",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 2,
    "kind": "external",
    "name": "NaN",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~NaN",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 3,
    "kind": "external",
    "name": "undefined",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~undefined",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 4,
    "kind": "external",
    "name": "null",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~null",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 5,
    "kind": "external",
    "name": "Object",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Object",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 6,
    "kind": "external",
    "name": "object",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~object",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 7,
    "kind": "external",
    "name": "Function",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Function",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 8,
    "kind": "external",
    "name": "function",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~function",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 9,
    "kind": "external",
    "name": "Boolean",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Boolean",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 10,
    "kind": "external",
    "name": "boolean",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~boolean",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 11,
    "kind": "external",
    "name": "Symbol",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Symbol",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 12,
    "kind": "external",
    "name": "Error",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Error",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 13,
    "kind": "external",
    "name": "EvalError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~EvalError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 14,
    "kind": "external",
    "name": "InternalError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~InternalError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 15,
    "kind": "external",
    "name": "RangeError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~RangeError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 16,
    "kind": "external",
    "name": "ReferenceError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~ReferenceError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 17,
    "kind": "external",
    "name": "SyntaxError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~SyntaxError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 18,
    "kind": "external",
    "name": "TypeError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~TypeError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 19,
    "kind": "external",
    "name": "URIError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~URIError",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 20,
    "kind": "external",
    "name": "Number",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Number",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 21,
    "kind": "external",
    "name": "number",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~number",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 22,
    "kind": "external",
    "name": "Date",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Date",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 23,
    "kind": "external",
    "name": "String",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~String",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 24,
    "kind": "external",
    "name": "string",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~string",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 25,
    "kind": "external",
    "name": "RegExp",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~RegExp",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 26,
    "kind": "external",
    "name": "Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 27,
    "kind": "external",
    "name": "Int8Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Int8Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 28,
    "kind": "external",
    "name": "Uint8Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Uint8Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 29,
    "kind": "external",
    "name": "Uint8ClampedArray",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Uint8ClampedArray",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 30,
    "kind": "external",
    "name": "Int16Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Int16Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 31,
    "kind": "external",
    "name": "Uint16Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Uint16Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 32,
    "kind": "external",
    "name": "Int32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Int32Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 33,
    "kind": "external",
    "name": "Uint32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Uint32Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 34,
    "kind": "external",
    "name": "Float32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Float32Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 35,
    "kind": "external",
    "name": "Float64Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Float64Array",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 36,
    "kind": "external",
    "name": "Map",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Map",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 37,
    "kind": "external",
    "name": "Set",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Set",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 38,
    "kind": "external",
    "name": "WeakMap",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~WeakMap",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 39,
    "kind": "external",
    "name": "WeakSet",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~WeakSet",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 40,
    "kind": "external",
    "name": "ArrayBuffer",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~ArrayBuffer",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 41,
    "kind": "external",
    "name": "DataView",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~DataView",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 42,
    "kind": "external",
    "name": "JSON",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~JSON",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 43,
    "kind": "external",
    "name": "Promise",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Promise",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 44,
    "kind": "external",
    "name": "Generator",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Generator",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 45,
    "kind": "external",
    "name": "GeneratorFunction",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~GeneratorFunction",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 46,
    "kind": "external",
    "name": "Reflect",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Reflect",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 47,
    "kind": "external",
    "name": "Proxy",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
    "memberof": "src/.external-ecmascript.js",
    "static": true,
    "longname": "src/.external-ecmascript.js~Proxy",
    "access": "public",
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 48,
    "kind": "file",
    "name": "src/BrokenLinkChecker.js",
    "content": "/* eslint-disable no-console */\n\nimport { spawn } from 'child_process';\nimport { join } from 'path';\nimport { parse } from 'url';\nimport yargs from 'yargs';\nimport express from 'express';\nimport getPort from 'get-port';\nimport colors from 'chalk';\nimport pkg from '../package.json';\nimport cliOptions from './cliOptions';\n\n/**\n * The Command Line Interface.\n */\nexport default class BrokenLinkChecker {\n\n  /**\n   * Creates a new BrokenLinkChecker with the specified options.\n   * @param {Array<string>} argv The arguments to handle.\n   */\n  constructor(argv = []) {\n    /**\n     * The arguments to handle.\n     * @type {String[]}\n     */\n    this._argv = argv;\n\n    /**\n     * `true` if serving a directory is needed to run the check.\n     * @type {Boolean}\n     */\n    this.needServer = true;\n\n    /**\n     * The path to check. Only set if a path is given as input.\n     * @type {String}\n     */\n    this.path = false;\n\n    /**\n     * The URL to check. Only set if a URL is given as input.\n     * @type {String}\n     */\n    this.url = false;\n\n    /**\n     * The parsed command line options used.\n     * @type {Object}\n     */\n    this.options = false;\n  }\n\n  /**\n   * The base url to use when serving files.\n   * @type {string}\n   */\n  get baseUrl() {\n    return this.options ? this.options.baseUrl : '/';\n  }\n\n  /**\n   * Starts a server serving {@link BrokenLinkChecker#path} on the speficied port.\n   * @param {number} port The port to server on.\n   * @return {Promise<number, Error>} Resolved with the port used, rejected with an error if\n   * listening on the port failed.\n   */\n  startServer(port) {\n    return new Promise((resolve, reject) => {\n      if (!this.path) {\n        reject(new Error('No path given'));\n      }\n\n      console.log(colors.white('Starting server for path:'), colors.yellow(this.path));\n      if (this.baseUrl !== '/') {\n        console.log(colors.gray(`Using base url '${this.options.baseUrl}'`));\n      }\n      /**\n       * The instance of {@link express.Application} used.\n       * @type {express.Application}\n       */\n      this.app = express();\n\n      this.app.use(this.baseUrl, express.static(this.path));\n\n      /**\n       * The server used.\n       * @type {http.Server}\n       */\n      this.server = this.app.listen(port);\n      this.server.on('listening', () => resolve(port));\n      this.server.on('error', err => reject(err));\n    });\n  }\n\n  /**\n   * Runs `blc` on the given port or {@link BrokenLinkChecker#url}.\n   * @param {number} [port] The port to check.\n   * @return {Promise<number>} Resolved with `blc`'s exit code.\n   */\n  runChecker(port) {\n    return new Promise((resolve, reject) => {\n      if (!port && !this.url) {\n        reject(new Error('No url given'));\n      } else {\n        let args = [\n          port ?\n            `http://localhost:${port}${this.baseUrl}` :\n            this.url,\n          '--colors',\n        ];\n\n        // Add options passed to blc\n        args = args.concat(this._argv);\n\n        const blc = spawn(require.resolve('broken-link-checker/bin/blc'), args, {\n          stdio: 'inherit',\n        });\n\n        blc.on('close', code => resolve(code));\n      }\n    });\n  }\n\n  /**\n   * Validates options.\n   * @return {Promise<Object, Error>} Fulfilled with the parsed options, rejected if validation\n   * failed.\n   */\n  validateOptions() {\n    return new Promise((resolve, reject) => {\n      this.options = yargs(this._argv)\n        .usage('Usage: $0 [options] <directory or url>')\n        .demandCommand(1, 1, 'Neither directory nor url given')\n        .version(pkg.version)\n        .alias('version', 'V')\n        .alias('help', 'h')\n        .option(cliOptions)\n        .help()\n        .fail((msg, err, y) => {\n          console.log(y.help());\n\n          reject(err || new Error(msg));\n        })\n        .argv;\n\n      // Add leading '/' to baseUrl if needed\n      if (this.options.baseUrl[0] !== '/') {\n        console.error('Adding slash');\n        this.options.baseUrl = `/${this.options.baseUrl}`;\n      }\n\n      resolve(this.options);\n    });\n  }\n\n  /**\n   * Sets either {@link BrokenLinkChecker#path} or {@link BrokenLinkChecker#path} from the first\n   * non-option argument provided.\n   */\n  getPathOrUrl() {\n    const dirOrUrl = this.options._[0];\n    const url = parse(dirOrUrl);\n\n    if (url.hostname) {\n      this.url = dirOrUrl;\n      this.needServer = false;\n    } else {\n      this.path = join(process.cwd(), dirOrUrl);\n    }\n  }\n\n  /**\n   * Exits BrokenLinkChecker with the specified exit code and (optionally) an error that occurred.\n   * @param {number} code The code to exit with.\n   * @param {Error} err The error to report.\n   * @return {number} Code The code to exit with.\n   */\n  exit(code, err) {\n    if (err) {\n      console.error(colors.red(`Error: ${err.message}`));\n    }\n\n    if (this.server) {\n      this.server.close();\n    }\n\n    process.exitCode = code;\n\n    return code;\n  }\n\n  /**\n   * Launches the CLI.\n   */\n  launch() {\n    return this.validateOptions()\n      .then(() => this.getPathOrUrl())\n      .then(() => {\n        if (this.needServer) {\n          return getPort()\n            .then(port => this.startServer(port))\n            .then(port => this.runChecker(port));\n        }\n\n        return this.runChecker();\n      })\n      .then(code => this.exit(code))\n      .catch(err => this.exit(1, err));\n  }\n\n}\n\n/**\n * @external {express.Application} http://expressjs.com/en/4x/api.html#app\n */\n\n/**\n * @external {http.Server} https://nodejs.org/api/http.html#http_class_http_server\n */\n",
    "static": true,
    "longname": "/home/circleci/project/src/BrokenLinkChecker.js",
    "access": "public",
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 49,
    "kind": "class",
    "name": "BrokenLinkChecker",
    "memberof": "src/BrokenLinkChecker.js",
    "static": true,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "access": "public",
    "export": true,
    "importPath": "broken-link-checker-local/src/BrokenLinkChecker.js",
    "importStyle": "BrokenLinkChecker",
    "description": "The Command Line Interface.",
    "lineNumber": 16,
    "interface": false
  },
  {
    "__docId__": 50,
    "kind": "external",
    "name": "express.Application",
    "externalLink": "http://expressjs.com/en/4x/api.html#app",
    "memberof": "src/BrokenLinkChecker.js",
    "static": true,
    "longname": "src/BrokenLinkChecker.js~express.Application",
    "access": "public",
    "description": ""
  },
  {
    "__docId__": 51,
    "kind": "external",
    "name": "http.Server",
    "externalLink": "https://nodejs.org/api/http.html#http_class_http_server",
    "memberof": "src/BrokenLinkChecker.js",
    "static": true,
    "longname": "src/BrokenLinkChecker.js~http.Server",
    "access": "public",
    "description": ""
  },
  {
    "__docId__": 52,
    "kind": "constructor",
    "name": "constructor",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#constructor",
    "access": "public",
    "description": "Creates a new BrokenLinkChecker with the specified options.",
    "lineNumber": 22,
    "params": [
      {
        "nullable": null,
        "types": [
          "Array<string>"
        ],
        "spread": false,
        "optional": false,
        "name": "argv",
        "description": "The arguments to handle."
      }
    ]
  },
  {
    "__docId__": 53,
    "kind": "member",
    "name": "_argv",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#_argv",
    "access": "private",
    "description": "The arguments to handle.",
    "lineNumber": 27,
    "type": {
      "nullable": null,
      "types": [
        "String[]"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 54,
    "kind": "member",
    "name": "needServer",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#needServer",
    "access": "public",
    "description": "`true` if serving a directory is needed to run the check.",
    "lineNumber": 33,
    "type": {
      "nullable": null,
      "types": [
        "Boolean"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 55,
    "kind": "member",
    "name": "path",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#path",
    "access": "public",
    "description": "The path to check. Only set if a path is given as input.",
    "lineNumber": 39,
    "type": {
      "nullable": null,
      "types": [
        "String"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 56,
    "kind": "member",
    "name": "url",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#url",
    "access": "public",
    "description": "The URL to check. Only set if a URL is given as input.",
    "lineNumber": 45,
    "type": {
      "nullable": null,
      "types": [
        "String"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 57,
    "kind": "member",
    "name": "options",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#options",
    "access": "public",
    "description": "The parsed command line options used.",
    "lineNumber": 51,
    "type": {
      "nullable": null,
      "types": [
        "Object"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 58,
    "kind": "get",
    "name": "baseUrl",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#baseUrl",
    "access": "public",
    "description": "The base url to use when serving files.",
    "lineNumber": 58,
    "type": {
      "nullable": null,
      "types": [
        "string"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 59,
    "kind": "method",
    "name": "startServer",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#startServer",
    "access": "public",
    "description": "Starts a server serving {@link BrokenLinkChecker#path} on the speficied port.",
    "lineNumber": 68,
    "params": [
      {
        "nullable": null,
        "types": [
          "number"
        ],
        "spread": false,
        "optional": false,
        "name": "port",
        "description": "The port to server on."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "Promise<number, Error>"
      ],
      "spread": false,
      "description": "Resolved with the port used, rejected with an error if\nlistening on the port failed."
    }
  },
  {
    "__docId__": 60,
    "kind": "member",
    "name": "app",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#app",
    "access": "public",
    "description": "The instance of {@link express.Application} used.",
    "lineNumber": 82,
    "type": {
      "nullable": null,
      "types": [
        "express.Application"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 61,
    "kind": "member",
    "name": "server",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#server",
    "access": "public",
    "description": "The server used.",
    "lineNumber": 90,
    "type": {
      "nullable": null,
      "types": [
        "http.Server"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 62,
    "kind": "method",
    "name": "runChecker",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#runChecker",
    "access": "public",
    "description": "Runs `blc` on the given port or {@link BrokenLinkChecker#url}.",
    "lineNumber": 101,
    "params": [
      {
        "nullable": null,
        "types": [
          "number"
        ],
        "spread": false,
        "optional": true,
        "name": "port",
        "description": "The port to check."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "Promise<number>"
      ],
      "spread": false,
      "description": "Resolved with `blc`'s exit code."
    }
  },
  {
    "__docId__": 63,
    "kind": "method",
    "name": "validateOptions",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#validateOptions",
    "access": "public",
    "description": "Validates options.",
    "lineNumber": 130,
    "return": {
      "nullable": null,
      "types": [
        "Promise<Object, Error>"
      ],
      "spread": false,
      "description": "Fulfilled with the parsed options, rejected if validation\nfailed."
    },
    "params": []
  },
  {
    "__docId__": 65,
    "kind": "method",
    "name": "getPathOrUrl",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#getPathOrUrl",
    "access": "public",
    "description": "Sets either {@link BrokenLinkChecker#path} or {@link BrokenLinkChecker#path} from the first\nnon-option argument provided.",
    "lineNumber": 161,
    "params": [],
    "return": null
  },
  {
    "__docId__": 69,
    "kind": "method",
    "name": "exit",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#exit",
    "access": "public",
    "description": "Exits BrokenLinkChecker with the specified exit code and (optionally) an error that occurred.",
    "lineNumber": 179,
    "params": [
      {
        "nullable": null,
        "types": [
          "number"
        ],
        "spread": false,
        "optional": false,
        "name": "code",
        "description": "The code to exit with."
      },
      {
        "nullable": null,
        "types": [
          "Error"
        ],
        "spread": false,
        "optional": false,
        "name": "err",
        "description": "The error to report."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "number"
      ],
      "spread": false,
      "description": "Code The code to exit with."
    }
  },
  {
    "__docId__": 70,
    "kind": "method",
    "name": "launch",
    "memberof": "src/BrokenLinkChecker.js~BrokenLinkChecker",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/BrokenLinkChecker.js~BrokenLinkChecker#launch",
    "access": "public",
    "description": "Launches the CLI.",
    "lineNumber": 196,
    "params": [],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 71,
    "kind": "file",
    "name": "src/bin.js",
    "content": "#!/usr/bin/env node\n\nimport BrokenLinkChecker from './BrokenLinkChecker';\n\n(new BrokenLinkChecker(process.argv.slice(2))).launch();\n",
    "static": true,
    "longname": "/home/circleci/project/src/bin.js",
    "access": "public",
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 72,
    "kind": "file",
    "name": "src/cliOptions.js",
    "content": "import blcDefaults from 'broken-link-checker/lib/internal/defaultOptions';\n\n/**\n * Command line options available\n * @type {Object}\n * @property {yargs.Option<String[]>} [exclude=[]] A keyword/glob to match links against. Can be\n * used multiple times.\n * @property {yargs.Option<Boolean>} [exclude-external=false] Will not check external links.\n * @property {yargs.Option<Boolean>} [exclude-internal=false] Will not check internal links.\n * @property {yargs.Option<Number>} [filter-level=1] The types of tags and attributes that are\n * considered links.\n * @property {yargs.Option<Boolean>} [follow=false] Force-follow robot exclusions.\n * @property {yargs.Option<Boolean>} [get=false] Change request method to GET.\n * @property {yargs.Option<Boolean>} [recursive=false] Recursively scan \"crawl\" the HTML\n * document(s).\n * @property {yargs.Option<String>} [user-agent] The user agent to use for link checks.\n * @property {yargs.Option<Boolean>} [verbose=false] Display excluded links.\n */\nconst CliOptions = {\n  exclude: {\n    desc: 'A keyword/glob to match links against. Can be used multiple times.',\n    default: blcDefaults.excludedKeywords,\n  },\n  'exclude-external': {\n    desc: 'Will not check external links.',\n    alias: 'e',\n    type: 'boolean',\n    default: false,\n  },\n  'exclude-internal': {\n    desc: 'Will not check internal links.',\n    alias: 'i',\n    type: 'boolean',\n    default: false,\n  },\n  'filter-level': {\n    desc: 'The types of tags and attributes that are considered links.\\n' +\n    '  0: clickable links\\n' +\n    '  1: 0 + media, iframes, meta refreshes\\n' +\n    '  2: 1 + stylesheets, scripts, forms\\n' +\n    '  3: 2 + metadata\\n',\n    type: 'number',\n    default: blcDefaults.filterLevel,\n  },\n  follow: {\n    desc: 'Force-follow robot exclusions.',\n    alias: 'f',\n    type: 'boolean',\n    default: false,\n  },\n  get: {\n    desc: 'Change request method to GET.',\n    alias: 'g',\n    type: 'boolean',\n    default: false,\n  },\n  ordered: {\n    desc: 'Maintain the order of links as they appear in their HTML document.',\n    alias: 'o',\n    type: 'boolean',\n    default: false,\n  },\n  recursive: {\n    desc: 'Recursively scan \"crawl\" the HTML document(s).',\n    alias: 'r',\n    type: 'boolean',\n    default: false,\n  },\n  'base-url': {\n    desc: 'Serve files using alternative base url.',\n    alias: 'b',\n    type: 'string',\n    default: '/',\n  },\n  'user-agent': {\n    desc: 'The user agent to use for link checks.',\n    type: 'string',\n    default: blcDefaults.userAgent,\n  },\n  verbose: {\n    desc: 'Display excluded links.',\n    alias: 'v',\n    type: 'boolean',\n    default: false,\n  },\n};\n\nexport default CliOptions;\n\n/**\n * @external {yargs.Option} http://yargs.js.org/docs/#methods-optionskey-opt\n */\n",
    "static": true,
    "longname": "/home/circleci/project/src/cliOptions.js",
    "access": "public",
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 73,
    "kind": "variable",
    "name": "CliOptions",
    "memberof": "src/cliOptions.js",
    "static": true,
    "longname": "src/cliOptions.js~CliOptions",
    "access": "public",
    "export": true,
    "importPath": "broken-link-checker-local/src/cliOptions.js",
    "importStyle": "CliOptions",
    "description": "Command line options available",
    "lineNumber": 19,
    "properties": [
      {
        "nullable": null,
        "types": [
          "yargs.Option<String[]>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "[]",
        "defaultRaw": [],
        "name": "exclude",
        "description": "A keyword/glob to match links against. Can be\nused multiple times."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Boolean>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "false",
        "defaultRaw": false,
        "name": "exclude-external",
        "description": "Will not check external links."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Boolean>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "false",
        "defaultRaw": false,
        "name": "exclude-internal",
        "description": "Will not check internal links."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Number>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "1",
        "defaultRaw": 1,
        "name": "filter-level",
        "description": "The types of tags and attributes that are\nconsidered links."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Boolean>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "false",
        "defaultRaw": false,
        "name": "follow",
        "description": "Force-follow robot exclusions."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Boolean>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "false",
        "defaultRaw": false,
        "name": "get",
        "description": "Change request method to GET."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Boolean>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "false",
        "defaultRaw": false,
        "name": "recursive",
        "description": "Recursively scan \"crawl\" the HTML\ndocument(s)."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<String>"
        ],
        "spread": false,
        "optional": true,
        "name": "user-agent",
        "description": "The user agent to use for link checks."
      },
      {
        "nullable": null,
        "types": [
          "yargs.Option<Boolean>"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "false",
        "defaultRaw": false,
        "name": "verbose",
        "description": "Display excluded links."
      }
    ],
    "type": {
      "nullable": null,
      "types": [
        "Object"
      ],
      "spread": false,
      "description": null
    }
  },
  {
    "__docId__": 74,
    "kind": "external",
    "name": "yargs.Option",
    "externalLink": "http://yargs.js.org/docs/#methods-optionskey-opt",
    "memberof": "src/cliOptions.js",
    "static": true,
    "longname": "src/cliOptions.js~yargs.Option",
    "access": "public",
    "description": ""
  },
  {
    "kind": "index",
    "content": "# broken-link-checker-local\n\n> Find broken links, missing images, etc in your HTML, even in local files.\n\n[![CircleCI](https://circleci.com/gh/LukasHechenberger/broken-link-checker-local.svg?style=shield&circle-token=5f7572151da460505166029bdfeefbc32d6bc720)](https://circleci.com/gh/LukasHechenberger/broken-link-checker-local)\n[![codecov](https://codecov.io/gh/LukasHechenberger/broken-link-checker-local/branch/master/graph/badge.svg?token=dPgjdXipFF)](https://codecov.io/gh/LukasHechenberger/broken-link-checker-local)\n[![API Docs](https://lukashechenberger.github.io/broken-link-checker-local/badge.svg)](https://lukashechenberger.github.io/broken-link-checker-local/)\n[![Greenkeeper badge](https://badges.greenkeeper.io/LukasHechenberger/broken-link-checker-local.svg)](https://greenkeeper.io/)\n\nJust a tiny wrapper around [broken-link-checker](https://github.com/stevenvachon/broken-link-checker) by [stevenvachon](https://github.com/stevenvachon) that allows you to check **local directories** for broken links.\n\n## Installation\n\nWith Node.js (version 6 or higher) installed, run\n\n```npm install -g broken-link-checker-local```\n\nto install this module globally.\n\n## Usage\n\n> All commands of [broken-link-checker](https://github.com/stevenvachon/broken-link-checker) can be used in exactly the same way with this module. The only difference is that **broken-link-checker-local is available as `blcl`**.\n\nIn addition to running checks on URLs by running\n\n```blcl http://yoursite.com -ro```\n\nyou can also check local directories by providing a path instead of a URL:\n\n```blcl ./path/to/directory -ro```\n\nYou can run `blcl --help` to check for available options.\n",
    "longname": "/home/circleci/project/README.md",
    "name": "./README.md",
    "static": true,
    "access": "public"
  },
  {
    "kind": "packageJSON",
    "content": "{\n  \"name\": \"broken-link-checker-local\",\n  \"version\": \"0.2.1\",\n  \"description\": \"Find broken links, missing images, etc in your HTML, even in local files\",\n  \"main\": \"out/BrokenLinkChecker.js\",\n  \"bin\": {\n    \"blcl\": \"out/bin.js\"\n  },\n  \"engines\": {\n    \"node\": \">=6.0\"\n  },\n  \"scripts\": {\n    \"compile\": \"babel src --out-dir out\",\n    \"compile:watch\": \"npm run compile -- --watch\",\n    \"docs\": \"esdoc -c esdoc.json\",\n    \"docs:coverage\": \"esdoc-coverage -c esdoc.json\",\n    \"lint\": \"eslint src test\",\n    \"prepublishOnly\": \"npm run compile && npm run docs\",\n    \"test\": \"node_modules/.bin/mocha --recursive --require @babel/register \\\"./test/**/*.spec.js\\\" --exit\",\n    \"test:watch\": \"npm test -- --watch --reporter min\",\n    \"test:coverage\": \"NODE_ENV=test node_modules/.bin/nyc --reporter=html npm test\",\n    \"test:docs\": \"node out/bin.js docs/api --exclude https://circleci.com/gh/LukasHechenberger/broken-link-checker-local\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/LukasHechenberger/broken-link-checker-local.git\"\n  },\n  \"author\": \"Lukas Hechenberger <admin@ls-age.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/LukasHechenberger/broken-link-checker-local/issues\"\n  },\n  \"homepage\": \"https://github.com/LukasHechenberger/broken-link-checker-local#readme\",\n  \"dependencies\": {\n    \"broken-link-checker\": \"^0.7.4\",\n    \"chalk\": \"^2.4.0\",\n    \"express\": \"^4.14.0\",\n    \"get-port\": \"^3.2.0\",\n    \"yargs\": \"^11.1.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.4.4\",\n    \"@babel/core\": \"^7.4.5\",\n    \"@babel/preset-env\": \"^7.4.5\",\n    \"@babel/register\": \"^7.4.4\",\n    \"@ls-age/bump-version\": \"^0.2.0\",\n    \"@ls-age/esdoc-coverage\": \"^0.1.6\",\n    \"@ls-age/eslint-config\": \"^0.9.0\",\n    \"babel-plugin-istanbul\": \"^5.1.4\",\n    \"codecov\": \"^3.5.0\",\n    \"esdoc\": \"^1.1.0\",\n    \"esdoc-standard-plugin\": \"^1.0.0\",\n    \"eslint\": \"^5.16.0\",\n    \"mocha\": \"^6.1.4\",\n    \"mocha-circleci-reporter\": \"0.0.3\",\n    \"nyc\": \"^14.1.1\",\n    \"sinon\": \"^7.3.2\",\n    \"supertest\": \"^4.0.2\",\n    \"unexpected\": \"^11.6.1\"\n  },\n  \"eslintConfig\": {\n    \"parserOptions\": {\n      \"ecmaVersion\": 2017\n    },\n    \"extends\": \"@ls-age\",\n    \"rules\": {\n      \"compat/compat\": \"off\"\n    }\n  },\n  \"babel\": {\n    \"presets\": [\n      [\n        \"@babel/env\",\n        {\n          \"targets\": {\n            \"node\": 8\n          }\n        }\n      ]\n    ],\n    \"env\": {\n      \"test\": {\n        \"plugins\": [\n          \"istanbul\"\n        ]\n      }\n    }\n  },\n  \"nyc\": {\n    \"all\": true,\n    \"include\": [\n      \"src/**/*.js\"\n    ],\n    \"require\": [\n      \"@babel/register\"\n    ],\n    \"sourceMap\": false,\n    \"instrument\": false,\n    \"check-coverage\": true\n  }\n}\n",
    "longname": "/home/circleci/project/package.json",
    "name": "package.json",
    "static": true,
    "access": "public"
  },
  {
    "kind": "manualIndex",
    "globalIndex": false,
    "content": null,
    "longname": "",
    "static": true,
    "access": "public"
  },
  {
    "kind": "manual",
    "longname": "/home/circleci/project/CHANGELOG.md",
    "name": "./CHANGELOG.md",
    "content": "<a name=\"0.2.1\"></a>\n## 0.2.1 (2019-06-21)\n\n\n### Bug Fixes\n\n* Security updates ([#22](https://github.com/LukasHechenberger/broken-link-checker-local/issues/22)) ([c87f03c](https://github.com/LukasHechenberger/broken-link-checker-local/commits/c87f03c))\n\n\n\n\n<a name=\"0.2.0\"></a>\n# 0.2.0 (2018-04-20)\n\n\n### Features\n\n* Use the 'base-url' option to specify a base url to serve from ([#6](https://github.com/LukasHechenberger/broken-link-checker-local/issues/6)) ([be70663](https://github.com/LukasHechenberger/broken-link-checker-local/commits/be70663)), closes [#4](https://github.com/LukasHechenberger/broken-link-checker-local/issues/4)\n\n\n\n\n<a name=\"0.1.2\"></a>\n## 0.1.2 (2018-04-09)\n\n\n### Bug Fixes\n\n* Setup continuous delivery ([6ace7d3](https://github.com/LukasHechenberger/broken-link-checker-local/commits/6ace7d3))\n\n\n\n",
    "static": true,
    "access": "public"
  },
  {
    "__docId__": 75,
    "kind": "testFile",
    "name": "test/BrokenLinkChecker.spec.js",
    "content": "import { createServer, Server } from 'http';\nimport { join } from 'path';\nimport expect from 'unexpected';\nimport { spy } from 'sinon';\nimport request from 'supertest';\nimport getPort from 'get-port';\nimport BrokenLinkChecker from '../src/BrokenLinkChecker';\n\n/** @test {BrokenLinkChecker} */\ndescribe('BrokenLinkChecker', function() {\n  /** @test {BrokenLinkChecker#startServer} */\n  describe('#startServer', function() {\n    const checker = new BrokenLinkChecker();\n    checker.path = __dirname;\n\n    it('should fail with invalid port', function() {\n      return expect(checker.startServer(-13), 'to be rejected with', /^Port should be/);\n    });\n\n    it('should create instance of express', function() {\n      return getPort()\n        .then(port => checker.startServer(port))\n        .then(() => {\n          expect(checker.app, 'to be a', 'function');\n        });\n    });\n\n    it('should create instance of http.Server', function() {\n      return getPort()\n        .then(port => checker.startServer(port))\n        .then(() => {\n          expect(checker.server, 'to be a', Server);\n        });\n    });\n\n    it('should serve on custom baseUrl if passed', async function() {\n      checker.options = { baseUrl: '/test/' };\n\n      const port = await getPort();\n      await checker.startServer(port);\n\n      const index = await request(checker.app).get('/');\n      expect(index.status, 'to equal', 404);\n\n      const customIndex = await request(checker.app).get('/test/BrokenLinkChecker.spec.js');\n      expect(customIndex.status, 'to equal', 200);\n    });\n\n    it('should fail without path', function() {\n      checker.path = false;\n      return expect(checker.startServer(9000), 'to be rejected with', 'No path given');\n    });\n  });\n\n  /** @test {BrokenLinkChecker#runChecker} */\n  describe('#runChecker', function() {\n    let checker;\n\n    this.timeout(5000);\n\n    beforeEach(() => (checker = new BrokenLinkChecker()));\n\n    it('should fail without port and url', function() {\n      return expect(checker.runChecker(), 'to be rejected with', 'No url given');\n    });\n\n    it('should fail with invalid url', function() {\n      checker.url = 'http://localhost:80';\n      return expect(checker.runChecker(), 'to be fulfilled with', 1);\n    });\n\n    it('should fail with path to invalid document', function() {\n      checker.path = join(__dirname, 'fixtures', 'broken');\n\n      return expect(\n        getPort()\n          .then(port => checker.startServer(port))\n          .then(port => checker.runChecker(port)),\n        'to be fulfilled with', 1\n      );\n    });\n\n    it('should work with path to valid document', function() {\n      checker.path = join(__dirname, 'fixtures', 'no-broken');\n\n      return expect(\n        getPort()\n          .then(port => checker.startServer(port))\n          .then(port => checker.runChecker(port)),\n        'to be fulfilled with', 0\n      );\n    });\n  });\n\n  /** @test {BrokenLinkChecker#validateOptions} */\n  describe('#validateOptions', function() {\n    it('should fail without non-optional argument', function() {\n      const checker = new BrokenLinkChecker();\n\n      return expect(checker.validateOptions(), 'to be rejected with',\n        'Neither directory nor url given'\n      );\n    });\n\n    it('should fail with multiple non-optional arguments ', function() {\n      const checker = new BrokenLinkChecker(['dir', 'another']);\n\n      return expect(checker.validateOptions(), 'to be rejected with',\n        'Too many non-option arguments: got 2, maximum of 1'\n      );\n    });\n\n    it('should work with single non-optional argument', function() {\n      const checker = new BrokenLinkChecker(['dir']);\n\n      return expect(checker.validateOptions(), 'when fulfilled', 'to be a', 'object');\n    });\n\n    it('should add leading slash to base-url if needed', async function() {\n      const checker = new BrokenLinkChecker(['dir', '--base-url', 'asdf']);\n\n      await expect(checker.validateOptions(), 'when fulfilled', 'to be a', 'object');\n      expect(checker.baseUrl, 'to equal', '/asdf');\n    });\n  });\n\n  /** @test {BrokenLinkChecker#getPathOrUrl} */\n  describe('#getPathOrUrl', function() {\n    it('should set url if a url is passed', function() {\n      const checker = new BrokenLinkChecker(['http://google.com']);\n\n      return checker.validateOptions()\n        .then(() => checker.getPathOrUrl())\n        .then(() => expect(checker.url, 'to equal', 'http://google.com'));\n    });\n\n    it('should set path if a path is passed', function() {\n      const checker = new BrokenLinkChecker(['./directory']);\n\n      return checker.validateOptions()\n        .then(() => checker.getPathOrUrl())\n        .then(() => expect(checker.path, 'to equal', join(process.cwd(), 'directory')));\n    });\n  });\n\n  /** @test {BrokenLinkChecker#exit} */\n  describe('#exit', function() {\n    let checker;\n    let consoleError;\n\n    before(function() {\n      consoleError = spy(console, 'error');\n    });\n\n    beforeEach(function() {\n      checker = new BrokenLinkChecker();\n    });\n\n    it('should set exitCode', function() {\n      checker.exit(123);\n      expect(process.exitCode, 'to equal', 123);\n    });\n\n    it('should report error', function() {\n      const errorMessage = 'an error';\n\n      checker.exit(1, new Error(errorMessage));\n      expect(consoleError.calledOnce, 'to be', true);\n      expect(consoleError.lastCall.args[0], 'to contain', errorMessage);\n    });\n\n    it('should close server', function(done) {\n      checker.server = createServer();\n      checker.server.on('close', done);\n\n      checker.exit(1);\n    });\n\n    after(function() {\n      console.error.restore(); // eslint-disable-line no-console\n    });\n  });\n\n  /** @test {BrokenLinkChecker#launch} */\n  describe('#launch', function() {\n    this.timeout(5000);\n\n    it('should fail with invalid directory', function() {\n      const checker = new BrokenLinkChecker([join('test', 'fixtures', 'broken')]);\n\n      return expect(checker.launch(), 'to be fulfilled with', 1);\n    });\n\n    it('should work with valid directory', function() {\n      const checker = new BrokenLinkChecker([join('test', 'fixtures', 'no-broken')]);\n\n      return expect(checker.launch(), 'to be fulfilled with', 0);\n    });\n\n    it('should fail with invalid url', function() {\n      const checker = new BrokenLinkChecker(['htt://ls-age.com']);\n\n      return expect(checker.launch(), 'to be fulfilled with', 1);\n    });\n\n    it('should work with valid url', function() {\n      const checker = new BrokenLinkChecker([join('test', 'fixtures', 'no-broken')]);\n\n      return expect(\n        getPort()\n          .then(() => checker.validateOptions())\n          .then(() => checker.getPathOrUrl())\n          .then(getPort)\n          .then(port => checker.startServer(port))\n          .then(port => (new BrokenLinkChecker([`http://localhost:${port}`])).launch()),\n        'to be fulfilled with', 0\n      );\n    });\n  });\n});\n",
    "static": true,
    "longname": "/home/circleci/project/test/BrokenLinkChecker.spec.js",
    "access": null,
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 76,
    "kind": "test",
    "name": "describe0",
    "testId": 0,
    "memberof": "test/BrokenLinkChecker.spec.js",
    "testDepth": 0,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0",
    "access": null,
    "description": "BrokenLinkChecker",
    "lineNumber": 10,
    "testTargets": [
      "BrokenLinkChecker"
    ]
  },
  {
    "__docId__": 77,
    "kind": "test",
    "name": "describe1",
    "testId": 1,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0",
    "testDepth": 1,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe1",
    "access": null,
    "description": "#startServer",
    "lineNumber": 12,
    "testTargets": [
      "BrokenLinkChecker#startServer"
    ]
  },
  {
    "__docId__": 78,
    "kind": "test",
    "name": "it2",
    "testId": 2,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe1",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe1.it2",
    "access": null,
    "description": "should fail with invalid port",
    "lineNumber": 16
  },
  {
    "__docId__": 79,
    "kind": "test",
    "name": "it3",
    "testId": 3,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe1",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe1.it3",
    "access": null,
    "description": "should create instance of express",
    "lineNumber": 20
  },
  {
    "__docId__": 80,
    "kind": "test",
    "name": "it4",
    "testId": 4,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe1",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe1.it4",
    "access": null,
    "description": "should create instance of http.Server",
    "lineNumber": 28
  },
  {
    "__docId__": 81,
    "kind": "test",
    "name": "it5",
    "testId": 5,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe1",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe1.it5",
    "access": null,
    "description": "should serve on custom baseUrl if passed",
    "lineNumber": 36
  },
  {
    "__docId__": 82,
    "kind": "test",
    "name": "it6",
    "testId": 6,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe1",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe1.it6",
    "access": null,
    "description": "should fail without path",
    "lineNumber": 49
  },
  {
    "__docId__": 83,
    "kind": "test",
    "name": "describe7",
    "testId": 7,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0",
    "testDepth": 1,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe7",
    "access": null,
    "description": "#runChecker",
    "lineNumber": 56,
    "testTargets": [
      "BrokenLinkChecker#runChecker"
    ]
  },
  {
    "__docId__": 84,
    "kind": "test",
    "name": "it8",
    "testId": 8,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe7",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe7.it8",
    "access": null,
    "description": "should fail without port and url",
    "lineNumber": 63
  },
  {
    "__docId__": 85,
    "kind": "test",
    "name": "it9",
    "testId": 9,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe7",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe7.it9",
    "access": null,
    "description": "should fail with invalid url",
    "lineNumber": 67
  },
  {
    "__docId__": 86,
    "kind": "test",
    "name": "it10",
    "testId": 10,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe7",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe7.it10",
    "access": null,
    "description": "should fail with path to invalid document",
    "lineNumber": 72
  },
  {
    "__docId__": 87,
    "kind": "test",
    "name": "it11",
    "testId": 11,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe7",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe7.it11",
    "access": null,
    "description": "should work with path to valid document",
    "lineNumber": 83
  },
  {
    "__docId__": 88,
    "kind": "test",
    "name": "describe12",
    "testId": 12,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0",
    "testDepth": 1,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe12",
    "access": null,
    "description": "#validateOptions",
    "lineNumber": 96,
    "testTargets": [
      "BrokenLinkChecker#validateOptions"
    ]
  },
  {
    "__docId__": 89,
    "kind": "test",
    "name": "it13",
    "testId": 13,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe12",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe12.it13",
    "access": null,
    "description": "should fail without non-optional argument",
    "lineNumber": 97
  },
  {
    "__docId__": 90,
    "kind": "test",
    "name": "it14",
    "testId": 14,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe12",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe12.it14",
    "access": null,
    "description": "should fail with multiple non-optional arguments ",
    "lineNumber": 105
  },
  {
    "__docId__": 91,
    "kind": "test",
    "name": "it15",
    "testId": 15,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe12",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe12.it15",
    "access": null,
    "description": "should work with single non-optional argument",
    "lineNumber": 113
  },
  {
    "__docId__": 92,
    "kind": "test",
    "name": "it16",
    "testId": 16,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe12",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe12.it16",
    "access": null,
    "description": "should add leading slash to base-url if needed",
    "lineNumber": 119
  },
  {
    "__docId__": 93,
    "kind": "test",
    "name": "describe17",
    "testId": 17,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0",
    "testDepth": 1,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe17",
    "access": null,
    "description": "#getPathOrUrl",
    "lineNumber": 128,
    "testTargets": [
      "BrokenLinkChecker#getPathOrUrl"
    ]
  },
  {
    "__docId__": 94,
    "kind": "test",
    "name": "it18",
    "testId": 18,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe17",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe17.it18",
    "access": null,
    "description": "should set url if a url is passed",
    "lineNumber": 129
  },
  {
    "__docId__": 95,
    "kind": "test",
    "name": "it19",
    "testId": 19,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe17",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe17.it19",
    "access": null,
    "description": "should set path if a path is passed",
    "lineNumber": 137
  },
  {
    "__docId__": 96,
    "kind": "test",
    "name": "describe20",
    "testId": 20,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0",
    "testDepth": 1,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe20",
    "access": null,
    "description": "#exit",
    "lineNumber": 147,
    "testTargets": [
      "BrokenLinkChecker#exit"
    ]
  },
  {
    "__docId__": 97,
    "kind": "test",
    "name": "it21",
    "testId": 21,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe20",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe20.it21",
    "access": null,
    "description": "should set exitCode",
    "lineNumber": 159
  },
  {
    "__docId__": 98,
    "kind": "test",
    "name": "it22",
    "testId": 22,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe20",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe20.it22",
    "access": null,
    "description": "should report error",
    "lineNumber": 164
  },
  {
    "__docId__": 99,
    "kind": "test",
    "name": "it23",
    "testId": 23,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe20",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe20.it23",
    "access": null,
    "description": "should close server",
    "lineNumber": 172
  },
  {
    "__docId__": 100,
    "kind": "test",
    "name": "describe24",
    "testId": 24,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0",
    "testDepth": 1,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe24",
    "access": null,
    "description": "#launch",
    "lineNumber": 185,
    "testTargets": [
      "BrokenLinkChecker#launch"
    ]
  },
  {
    "__docId__": 101,
    "kind": "test",
    "name": "it25",
    "testId": 25,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe24",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe24.it25",
    "access": null,
    "description": "should fail with invalid directory",
    "lineNumber": 188
  },
  {
    "__docId__": 102,
    "kind": "test",
    "name": "it26",
    "testId": 26,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe24",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe24.it26",
    "access": null,
    "description": "should work with valid directory",
    "lineNumber": 194
  },
  {
    "__docId__": 103,
    "kind": "test",
    "name": "it27",
    "testId": 27,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe24",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe24.it27",
    "access": null,
    "description": "should fail with invalid url",
    "lineNumber": 200
  },
  {
    "__docId__": 104,
    "kind": "test",
    "name": "it28",
    "testId": 28,
    "memberof": "test/BrokenLinkChecker.spec.js~describe0.describe24",
    "testDepth": 2,
    "static": true,
    "longname": "test/BrokenLinkChecker.spec.js~describe0.describe24.it28",
    "access": null,
    "description": "should work with valid url",
    "lineNumber": 206
  }
]