{
  "manifest": {
    "name": "error-ex",
    "description": "Easy error subclassing and stack customization",
    "version": "1.3.2",
    "maintainers": [
      {
        "name": "Josh Junon",
        "email": "i.am.qix@gmail.com",
        "url": "github.com/qix-"
      },
      {
        "name": "Sindre Sorhus",
        "email": "sindresorhus@gmail.com",
        "url": "sindresorhus.com"
      }
    ],
    "keywords": [
      "error",
      "errors",
      "extend",
      "extending",
      "extension",
      "subclass",
      "stack",
      "custom"
    ],
    "license": "MIT",
    "scripts": {
      "pretest": "xo",
      "test": "mocha --compilers coffee:coffee-script/register"
    },
    "xo": {
      "rules": {
        "operator-linebreak": [
          0
        ]
      }
    },
    "repository": {
      "type": "git",
      "url": "https://github.com/qix-/node-error-ex.git"
    },
    "files": [
      "index.js"
    ],
    "devDependencies": {
      "coffee-script": "^1.9.3",
      "coveralls": "^2.11.2",
      "istanbul": "^0.3.17",
      "mocha": "^2.2.5",
      "should": "^7.0.1",
      "xo": "^0.7.1"
    },
    "dependencies": {
      "is-arrayish": "^0.2.1"
    },
    "_registry": "npm",
    "_loc": "/home/josie/.cache/yarn/v6/npm-error-ex-1.3.2-b4ac40648107fdcdcfae242f428bea8a14d4f1bf-integrity/node_modules/error-ex/package.json",
    "readmeFilename": "README.md",
    "readme": "# node-error-ex [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-error-ex.svg?style=flat-square)](https://travis-ci.org/Qix-/node-error-ex) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-error-ex.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-error-ex)\n> Easily subclass and customize new Error types\n\n## Examples\nTo include in your project:\n```javascript\nvar errorEx = require('error-ex');\n```\n\nTo create an error message type with a specific name (note, that `ErrorFn.name`\nwill not reflect this):\n```javascript\nvar JSONError = errorEx('JSONError');\n\nvar err = new JSONError('error');\nerr.name; //-> JSONError\nthrow err; //-> JSONError: error\n```\n\nTo add a stack line:\n```javascript\nvar JSONError = errorEx('JSONError', {fileName: errorEx.line('in %s')});\n\nvar err = new JSONError('error')\nerr.fileName = '/a/b/c/foo.json';\nthrow err; //-> (line 2)-> in /a/b/c/foo.json\n```\n\nTo append to the error message:\n```javascript\nvar JSONError = errorEx('JSONError', {fileName: errorEx.append('in %s')});\n\nvar err = new JSONError('error');\nerr.fileName = '/a/b/c/foo.json';\nthrow err; //-> JSONError: error in /a/b/c/foo.json\n```\n\n## API\n\n#### `errorEx([name], [properties])`\nCreates a new ErrorEx error type\n\n- `name`: the name of the new type (appears in the error message upon throw;\n  defaults to `Error.name`)\n- `properties`: if supplied, used as a key/value dictionary of properties to\n  use when building up the stack message. Keys are property names that are\n  looked up on the error message, and then passed to function values.\n\t- `line`: if specified and is a function, return value is added as a stack\n    entry (error-ex will indent for you). Passed the property value given\n    the key.\n  - `stack`: if specified and is a function, passed the value of the property\n    using the key, and the raw stack lines as a second argument. Takes no\n    return value (but the stack can be modified directly).\n  - `message`: if specified and is a function, return value is used as new\n    `.message` value upon get. Passed the property value of the property named\n    by key, and the existing message is passed as the second argument as an\n    array of lines (suitable for multi-line messages).\n\nReturns a constructor (Function) that can be used just like the regular Error\nconstructor.\n\n```javascript\nvar errorEx = require('error-ex');\n\nvar BasicError = errorEx();\n\nvar NamedError = errorEx('NamedError');\n\n// --\n\nvar AdvancedError = errorEx('AdvancedError', {\n\tfoo: {\n\t\tline: function (value, stack) {\n\t\t\tif (value) {\n\t\t\t\treturn 'bar ' + value;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\nvar err = new AdvancedError('hello, world');\nerr.foo = 'baz';\nthrow err;\n\n/*\n\tAdvancedError: hello, world\n\t    bar baz\n\t    at tryReadme() (readme.js:20:1)\n*/\n```\n\n#### `errorEx.line(str)`\nCreates a stack line using a delimiter\n\n> This is a helper function. It is to be used in lieu of writing a value object\n> for `properties` values.\n\n- `str`: The string to create\n  - Use the delimiter `%s` to specify where in the string the value should go\n\n```javascript\nvar errorEx = require('error-ex');\n\nvar FileError = errorEx('FileError', {fileName: errorEx.line('in %s')});\n\nvar err = new FileError('problem reading file');\nerr.fileName = '/a/b/c/d/foo.js';\nthrow err;\n\n/*\n\tFileError: problem reading file\n\t    in /a/b/c/d/foo.js\n\t    at tryReadme() (readme.js:7:1)\n*/\n```\n\n#### `errorEx.append(str)`\nAppends to the `error.message` string\n\n> This is a helper function. It is to be used in lieu of writing a value object\n> for `properties` values.\n\n- `str`: The string to append\n  - Use the delimiter `%s` to specify where in the string the value should go\n\n```javascript\nvar errorEx = require('error-ex');\n\nvar SyntaxError = errorEx('SyntaxError', {fileName: errorEx.append('in %s')});\n\nvar err = new SyntaxError('improper indentation');\nerr.fileName = '/a/b/c/d/foo.js';\nthrow err;\n\n/*\n\tSyntaxError: improper indentation in /a/b/c/d/foo.js\n\t    at tryReadme() (readme.js:7:1)\n*/\n```\n\n## License\nLicensed under the [MIT License](http://opensource.org/licenses/MIT).\nYou can find a copy of it in [LICENSE](LICENSE).\n",
    "licenseText": "The MIT License (MIT)\n\nCopyright (c) 2015 JD Ballard\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz",
    "hash": "b4ac40648107fdcdcfae242f428bea8a14d4f1bf",
    "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
    "registry": "npm",
    "packageName": "error-ex",
    "cacheIntegrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== sha1-tKxAZIEH/c3PriQvQovqihTU8b8="
  },
  "registry": "npm",
  "hash": "b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
}