{"name":"err-code","version":"3.0.0","description":"Create an error with a code","main":"index.js","types":"index.d.ts","scripts":{"lint":"eslint '{*.js,test/**/*.js}' --ignore-pattern *.umd.js","check":"tsc --build","test":"mocha --bail","browserify":"browserify -s err-code index.js > index.umd.js"},"bugs":{"url":"https://github.com/IndigoUnited/js-err-code/issues/"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/js-err-code.git"},"keywords":["error","err","code","properties","property"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","devDependencies":{"@satazor/eslint-config":"^3.0.0","@types/expect.js":"0.3.29","@types/mocha":"8.2.0","browserify":"^14.0.0","eslint":"^3.0.0","expect.js":"^0.3.1","mocha":"^3.0.2","typescript":"^4.1.3"},"gitHead":"5e774e07af7ce7421450f22313490167394b013f","homepage":"https://github.com/IndigoUnited/js-err-code#readme","_id":"err-code@3.0.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-+oiZkhFGx8PLWbQM/Noi9arR8MAs4ZLEJlzhjSsqsb5lgiSlByIt3aL8TSp/AZ8g95lIDcJeBErlERg9Q9a4ow==","shasum":"8d5af04379f18eeb31e9dce0ca82be8386039c23","tarball":"http://registry-npm.ywwl.com/err-code/download/err-code-3.0.0.tgz","fileCount":13,"unpackedSize":14895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGUgPCRA9TVsSAnZWagAA0zYP/071IQNAQ0VeggSiEvWT\n8RG1yPNl+SkcyfDrNERHX5u7U3NemaYSgJY/j4xSP2b1PDjbazkkIvzylIE9\nET3COrHI8LoKsyuvWRhKwPPvzirTfpecgU9howeFIy8HT2Rt2EZia/aqtQz6\nDKCPvwNVSrvIY+HJwbt0LP2S/WDxwFwWJEgthUlI3etPkWfKhvjDmrz6pZke\naQ3Pnpi5hTzvVIuL7PEea9M1cbwiYPiKDu68D0BzKPw72SmmYz6QvO2E4ImE\nvyIwC43ZzzV+9m4/URAn0ZvN/svd5qF3nlQCIdLJ/npxb1enq+jB8DLkHwPm\n5E3EsIPJh5PNmMVyzTMqo9OpCFJW8hXlEG9f5KwM6fDMSd0WFMGsKE6f7ufZ\nX2Rp/YNzJ+ji8UEGGPfHTv5Iue6CYjW7xEx404shu6U2m5Nf8SDnyae2kFgD\nTDGTVgiontv1EXDdJDav8lh9uQ5L72/bn4IwGH/65PKi59EHbxImwLHDIZtu\nLoAKnl8KKOVPYpiKqSIgGygVntFnJf+WmzAZH0Hpr2eVPBBadTmbLGqiBBG1\nu/EZlHF4s4Lm+MPIVc6KbalLY/0CVynhtFCYzhL4p6Ptzvl0u/EvJDGBhccV\ngWPFIr+Z+2tdGm2DgqgzQ4cG8E1t/sYphnuipJzjUdiVcROjp7ykq9mYtV9C\nIpyi\r\n=grFX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQQq+cCrJgI6XTipfU+qfbNPSp7o3lzdjARnyp8kgAwAiArLPkljcFX1FaQxDkalIfdQG1Z99SMeC82JF2cxgWPYg=="}],"size":4464,"noattachment":false,"key":"/err-code/-/err-code-3.0.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"satazor","email":"andremiguelcruz@msn.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/err-code_3.0.0_1612269582574_0.9812419209318672"},"_hasShrinkwrap":false,"readme":"# err-code\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]\n\n[npm-url]:https://npmjs.org/package/err-code\n[downloads-image]:http://img.shields.io/npm/dm/err-code.svg\n[npm-image]:http://img.shields.io/npm/v/err-code.svg\n[travis-url]:https://travis-ci.org/IndigoUnited/js-err-code\n[travis-image]:http://img.shields.io/travis/IndigoUnited/js-err-code/master.svg\n[david-dm-url]:https://david-dm.org/IndigoUnited/js-err-code\n[david-dm-image]:https://img.shields.io/david/IndigoUnited/js-err-code.svg\n[david-dm-dev-url]:https://david-dm.org/IndigoUnited/js-err-code?type=dev\n[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/js-err-code.svg\n[greenkeeper-image]:https://badges.greenkeeper.io/IndigoUnited/js-err-code.svg\n[greenkeeper-url]:https://greenkeeper.io/\n\nCreate new error instances with a code and additional properties.\n\n\n## Installation\n\n```console\n$ npm install err-code\n// or\n$ bower install err-code\n```\n\nThe browser file is named index.umd.js which supports CommonJS, AMD and globals (errCode).\n\n\n## Why\n\nI find myself doing this repeatedly:\n\n```js\nvar err = new Error('My message');\nerr.code = 'SOMECODE';\nerr.detail = 'Additional information about the error';\nthrow err;\n```\n\n\n## Usage\n\nSimple usage.\n\n```js\nvar errcode = require('err-code');\n\n// fill error with message + code\nthrow errcode(new Error('My message'), 'ESOMECODE');\n// fill error with message + code + props\nthrow errcode(new Error('My message'), 'ESOMECODE', { detail: 'Additional information about the error' });\n// fill error with message + props\nthrow errcode(new Error('My message'), { detail: 'Additional information about the error' });\n```\n\n## Pre-existing fields\n\nIf the passed `Error` already has a `.code` field, or fields specified in the third argument to `errcode` they will be overwritten, unless the fields are read only or otherwise throw during assignment in which case a new object will be created that shares a prototype chain with the original `Error`. The `.stack` and `.message` properties will be carried over from the original error and `.code` or any passed properties will be set on it.\n\n\n## Tests\n\n`$ npm test`\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n","publish_time":1612269582703,"_cnpm_publish_time":1612269582703,"dist-tags":{"latest":"3.0.1"}}