{"_id":"always-error","_rev":"102114","name":"always-error","description":"Ensure the argument is an instance of Error or convert it","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"bahmutov","email":"gleb.bahmutov@gmail.com"}],"time":{"modified":"2021-06-03T10:35:50.000Z","created":"2016-03-29T17:33:40.778Z","1.0.0":"2016-03-29T17:33:40.778Z"},"users":{},"author":{"name":"Gleb Bahmutov","email":"gleb.bahmutov@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/bahmutov/always-error.git"},"versions":{"1.0.0":{"name":"always-error","version":"1.0.0","description":"Ensure the argument is an instance of Error or convert it","author":{"name":"Gleb Bahmutov","email":"gleb.bahmutov@gmail.com"},"bugs":{"url":"https://github.com/bahmutov/always-error/issues"},"config":{"pre-git":{"commit-msg":"simple","pre-commit":["npm test","npm run ban"],"pre-push":["npm run secure","npm run license","npm run ban -- --all","npm run size"],"post-commit":[],"post-merge":[]}},"files":["index.js","src/*.js","!src/*-spec.js"],"homepage":"https://github.com/bahmutov/always-error#readme","keywords":["convert","crash","error","report","utility"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"git+https://github.com/bahmutov/always-error.git"},"scripts":{"ban":"ban","format":"standard-format -w index.js src/*.js","issues":"git-issues","license":"license-checker --production --onlyunknown --csv","lint":"standard --verbose index.js src/*.js","pretest":"npm run format && npm run lint","secure":"nsp check","size":"t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";","test":"npm run unit","unit":"mocha src/*-spec.js","commit":"commit-wizard","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"devDependencies":{"ban-sensitive-files":"1.8.2","check-more-types":"2.13.0","git-issues":"1.2.0","lazy-ass":"1.4.0","license-checker":"5.1.0","mocha":"2.4.5","nsp":"2.2.2","pre-git":"3.7.1","standard":"6.0.8","standard-format":"2.1.1","semantic-release":"^4.3.5"},"gitHead":"64c4bff59601807dc634320ac2bd6b9c53ff894e","_id":"always-error@1.0.0","_shasum":"95c84042cfa86f38c86ca6c2cc42c0a0103441b2","_from":".","_npmVersion":"2.15.2","_nodeVersion":"4.4.1","_npmUser":{"name":"bahmutov","email":"gleb.bahmutov@gmail.com"},"dist":{"shasum":"95c84042cfa86f38c86ca6c2cc42c0a0103441b2","size":2268,"noattachment":false,"key":"/always-error/-/always-error-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/always-error/download/always-error-1.0.0.tgz"},"maintainers":[{"name":"bahmutov","email":"gleb.bahmutov@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/always-error-1.0.0.tgz_1459272818301_0.6601254558190703"},"directories":{},"publish_time":1459272820778,"_cnpm_publish_time":1459272820778,"_hasShrinkwrap":false}},"readme":"# always-error\n\n> Ensure the argument is an instance of Error or convert it\n\n[![NPM][npm-icon] ][npm-url]\n\n[![Build status][ci-image] ][ci-url]\n[![semantic-release][semantic-image] ][semantic-url]\n[![js-standard-style][standard-image]][standard-url]\n\n## Install and use\n\n```sh\nnpm install --save always-error\n```\n\n```js\nconst alwaysError = require('always-error')\nfunction reportError(x) {\n  // hmm, is x an instance of Error or not?\n  report(alwaysError(x))\n}\n```\n\nIf `x` is already an instance of Error, then it is passed unchanged, otherwise converted into one.\n\n### Small print\n\nAuthor: Gleb Bahmutov &lt;gleb.bahmutov@gmail.com&gt; &copy; 2016\n\n\n* [@bahmutov](https://twitter.com/bahmutov)\n* [glebbahmutov.com](http://glebbahmutov.com)\n* [blog](http://glebbahmutov.com/blog)\n\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSupport: if you find any problems with this module, email / tweet /\n[open issue](https://github.com/bahmutov/always-error/issues) on Github\n\n## MIT License\n\nCopyright (c) 2016 Gleb Bahmutov &lt;gleb.bahmutov@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n[npm-icon]: https://nodei.co/npm/always-error.png?downloads=true\n[npm-url]: https://npmjs.org/package/always-error\n[ci-image]: https://travis-ci.org/bahmutov/always-error.png?branch=master\n[ci-url]: https://travis-ci.org/bahmutov/always-error\n[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-url]: https://github.com/semantic-release/semantic-release\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[standard-url]: http://standardjs.com/\n","_attachments":{},"homepage":"https://github.com/bahmutov/always-error#readme","bugs":{"url":"https://github.com/bahmutov/always-error/issues"},"license":"MIT"}