{"_id":"@bakjs/dev-errors","_rev":"2-56bd3d98f4b46cfd7221ed06b4061137","name":"@bakjs/dev-errors","dist-tags":{"latest":"2.1.0-1"},"versions":{"2.1.0-1":{"name":"@bakjs/dev-errors","description":"Return better error details and skip the look at command line to catch the issue.","version":"2.1.0-1","author":{"name":"Future Studio","email":"info@futurestud.io"},"bugs":{"url":"https://github.com/fs-opensource/hapi-dev-errors/issues"},"dependencies":{"hoek":"~5.0.3","youch":"~2.0.7"},"devDependencies":{"boom":"~7.1.1","code":"~5.2.0","eslint-config-standard":"~10.2.1","eslint-plugin-import":"~2.8.0","eslint-plugin-node":"~5.2.1","eslint-plugin-promise":"~3.6.0","eslint-plugin-standard":"~3.0.1","hapi":"~17.2.0","husky":"~0.14.3","lab":"~15.2.2","vision":"~5.3.1"},"engines":{"node":">=8.0.0"},"homepage":"https://github.com/fs-opensource/hapi-dev-errors#readme","keywords":["developer","error","errors","hapi","hapijs","plugin"],"license":"MIT","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/fs-opensource/hapi-dev-errors.git"},"scripts":{"test":"lab --assert code --leaks --coverage --lint","prepush":"npm test"},"gitHead":"43f0489d67650eb4f66b1a73fe2f1286b6afdbb2","_id":"@bakjs/dev-errors@2.1.0-1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"dist":{"integrity":"sha512-y0zxlA4UmU1sXPLkh5tVeZ6pn+fR5Lp4GwcFvxZmt67rVGMYjwPAkhJTHn/4Ryyulsb+IneMBHwQzCUIioonuw==","shasum":"b272ffff7f15a96be71e5dcc313c3692a79509ea","tarball":"https://registry.npmjs.org/@bakjs/dev-errors/-/dev-errors-2.1.0-1.tgz","fileCount":22,"unpackedSize":239065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCuRACRA9TVsSAnZWagAAbm8QAI+fx2L0yv1jek6F+rV5\npE0055G+HyvhMwVVyE2/ZFAHGLYjAIR7a8EEGz+AL6Q9Fd+oPZsjNIzAhLlp\nSICspsjW69xwyb8/aLwfMb74vFEq8yLyZzlkfVbw4tt/i3aRdFdX0Qtwnk0y\nL1GsrILdL7neHaMRomuw/BEmBp98K8si+9AUgOYMYtRi3MG042zZI6ApO8Lz\nTbfwBzgpL5Oq/+qxgFa6Fkae8g7xqsi/CYuq+xtoKZ1egSspM3zP14fafugU\nVBvdKMs9hQsfT13nQfeqE+9m/nKiU1QeBxJ7qXXFaycnfHFOyJzdZOVgfqkg\nE99DNQ3TGh0/tzUuN2UTKTq8NU/zb9wVDnIBL5g4j3C85MDWGhqcix9HtcJ1\n3cWBFtyELXqJ5PXigkxjoZoTD+C0A/Bznho8NTd27sCSA7H381hZ2jaVxqhh\nx+Q0Ft25aC409dkEDz9wu9isb/n9OEyi8a6HPUrrp064NXnBB7DNNkZHITCh\nBN8YF0lAn0axluAKtZch+hRzHEerOpKfnBGfQ0RZUaLUxs/ELxdfuicnndva\nUKZSj1gdf3DTEKv0QZHiBvv66mLnKmeh6vTNzS1UaDoKDa4zgFRTbesrlNfy\njpHZv4INwDgtlLYpNYKfTOmYTpu3Jf9WvrDKLHm2+tVHrVZa+Cmks9mJ500b\nbA7t\r\n=/2oe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo0Vs8YgPI0AYMQ9j22e3Rov26nag7dT4+aVAsxIvPMAiEA/u5yEYEggzQ2kFwJxbf9Mia6xIrxS5g5IHq/mxnhYZY="}]},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dev-errors_2.1.0-1_1527440445676_0.6270068497697172"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-27T17:00:45.429Z","2.1.0-1":"2018-05-27T17:00:46.786Z","modified":"2022-04-04T17:32:11.705Z"},"maintainers":[{"email":"farnabaz@gmail.com","name":"farnabaz"},{"email":"pyapar@gmail.com","name":"pi0"}],"description":"Return better error details and skip the look at command line to catch the issue.","homepage":"https://github.com/fs-opensource/hapi-dev-errors#readme","keywords":["developer","error","errors","hapi","hapijs","plugin"],"repository":{"type":"git","url":"git+https://github.com/fs-opensource/hapi-dev-errors.git"},"author":{"name":"Future Studio","email":"info@futurestud.io"},"bugs":{"url":"https://github.com/fs-opensource/hapi-dev-errors/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <img height=\"256\" src=\"https://github.com/fs-opensource/hapi-dev-errors/blob/master/media/hapi-dev-errors.png?raw=true\" alt=\"hapi-dev-errors logo\">\n</p>\n\n<p align=\"center\">\n    <a href=\"https://travis-ci.org/fs-opensource/hapi-dev-errors\"><img src=\"https://camo.githubusercontent.com/9f56ef242c6f588f74f39f0bd61c1acd34d853af/68747470733a2f2f7472617669732d63692e6f72672f66732d6f70656e736f757263652f686170692d67656f2d6c6f636174652e7376673f6272616e63683d6d6173746572\" alt=\"Build Status\" data-canonical-src=\"https://travis-ci.org/fs-opensource/hapi-dev-errors.svg?branch=master\" style=\"max-width:100%;\"></a>\n    <a href=\"https://snyk.io/test/github/fs-opensource/hapi-dev-errors\"><img src=\"https://snyk.io/test/github/fs-opensource/hapi-dev-errors/badge.svg\" alt=\"Known Vulnerabilities\" data-canonical-src=\"https://snyk.io/test/github/fs-opensource/hapi-dev-errors\" style=\"max-width:100%;\"></a>\n    <a href=\"https://www.npmjs.com/package/hapi-dev-errors\"><img src=\"https://img.shields.io/npm/v/hapi-dev-errors.svg\" alt=\"hapi-dev-errors Version\" data-canonical-src=\"https://img.shields.io/npm/v/hapi-dev-errors.svg\" style=\"max-width:100%;\"></a>\n</p>\n\n------\n\n<p align=\"center\"><sup>Development of this hapi plugin is supported by <a href=\"https://futurestud.io\">Future Studio University 🚀</a></sup>\n<br><b>\nJoin the <a href=\"https://futurestud.io/university\">Future Studio University and Skyrocket in Node.js</a></b>\n</p>\n\n------\n\n\n## Introduction\nA hapi plugin to return an error view for web requests, providing more details of the issue. Also, provides the\nerror stacktrace within the browser and you can skip the extra look at your command line to catch the issue.\n\n![hapi-dev-errors default error view](media/hapi-dev-errors-default-view.png)\n\nYou can choose [Youch](https://github.com/poppinss/youch) to handle your error reporting by using the `useYouch: true`\n[option](https://github.com/fs-opensource/hapi-dev-errors#plugin-registration-options). `hapi-dev-errors` integrates\nseamlessly with Youch and delegates the error handling, if activated. The view will look like this:\n\n![hapi-dev-errors Youch error view](media/hapi-dev-errors-useYouch-view.png)\n\n\n## Requirements\nThis plugin uses async/await which requires **Node.js v8 or newer**.\n\n\n## Installation\nAdd `@bakjs/dev-errors` as a dependency to your project:\n\n```bash\nnpm i -S @bakjs/dev-errors\n# you’re using NPM shortcuts to (i)nstall and (-S)ave the module as a dependency\n\n# NPM v5 users, this way is yours\nnpm i @bakjs/dev-errors\n```\n\n\n## Examples\nCheck out the [examples](https://github.com/fs-opensource/hapi-dev-errors/tree/master/examples) directory and get\nan impression on how to configure `hapi-dev-errors` with the individual plugins options and how to customize the\nerror view.\n\n## Usage\n**`hapi-dev-errors` is disabled by default to avoid leaking sensitive error details during production.**\n\nEnable the plugin by define a \"truthy\" value for the `showErrors` option.\n\nThe most straight forward way to register the `hapi-dev-errors` plugin:\n\n```js\nawait server.register({\n    plugin: require('hapi-dev-errors'),\n    options: {\n      showErrors: process.env.NODE_ENV !== 'production'\n    }\n})\n\n// went smooth like chocolate :)\n```\n\n\n## Plugin Registration Options\nThe following plugin options allow you to customize the default behavior of `hapi-dev-errors`:\n\n- **showErrors**: `(boolean)`, default: `false` — by default, the plugin is disabled and keeps hapi's default error handling behavior\n- **useYouch**: `(boolean)`, default: `false` — use [Youch](https://github.com/poppinss/youch) to handle and display the error instead of using `hapi-dev-error`’s default handling\n- **template**: `(string)`, no default — provide the template name that you want to render with `h.view(template, errorData)`\n\n```js\nawait server.register({\n    plugin: require('hapi-dev-errors'),\n    options: {\n        showErrors: process.env.NODE_ENV !== 'production',\n        template: 'my-error-view'\n    }\n})\n\n// went smooth like chocolate :)\n```\n\n## Provided Values for Your Custom Error View\n`hapi-dev-errors` supports the `template` option while registering the plugin. Provide a template name to\nuse your personal error template and not the default one shipped with `hapi-dev-errors`. In case you pass a string\nvalue for the template name, the view will be rendered with `h.view(template, errorData).code(500)`.\n\nAvailable properties to use in your custom error view:\n\n- `title`: error title like `Internal Server Error`\n- `statusCode`: HTTP response status code (always 500)\n- `message`: error message, like `Uncaught error: h.view(...).test is not a function`\n- `method`: HTTP request method, like `GET`\n- `url`: URL request path, like `/signup`\n- `headers`: HTTP request headers object, in key-value format\n- `payload`: HTTP request payload, only available for HTTP methods other than `GET`, in key-value format\n- `stacktrace`: error stacktrace\n\n\n## Feature Requests\nDo you miss a feature? Please don’t hesitate to\n[create an issue](https://github.com/fs-opensource/hapi-dev-errors/issues) with a short description of your\ndesired addition to this plugin.\n\n\n## Links & Resources\n\n- [hapi tutorial series](https://futurestud.io/tutorials/hapi-get-your-server-up-and-running) with 80+ tutorials\n- [Youch](https://github.com/poppinss/youch) - Pretty error reporting for Node.js\n\n## Contributing\n\n1.  Create a fork\n2.  Create your feature branch: `git checkout -b my-feature`\n3.  Commit your changes: `git commit -am 'Add some feature'`\n4.  Push to the branch: `git push origin my-new-feature`\n5.  Submit a pull request 🚀\n\n\n## License\n\nMIT © [Future Studio](https://futurestud.io)\n\n---\n\n> [futurestud.io](https://futurestud.io) &nbsp;&middot;&nbsp;\n> GitHub [@fs-opensource](https://github.com/fs-opensource/) &nbsp;&middot;&nbsp;\n> Twitter [@futurestud_io](https://twitter.com/futurestud_io)\n","readmeFilename":"README.md"}