{"name":"err-code","version":"1.1.1","description":"Create an error with a code","main":"index.js","scripts":{"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":"^1.0.8","browserify":"^13.0.0","expect.js":"^0.3.1","mocha":"^2.3.4"},"gitHead":"51cf8730f49dc6e12580e22ed714c7bc52238889","homepage":"https://github.com/IndigoUnited/js-err-code#readme","_id":"err-code@1.1.1","_shasum":"739d71b6851f24d050ea18c79a5b722420771d59","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"dist":{"shasum":"739d71b6851f24d050ea18c79a5b722420771d59","tarball":"http://registry-npm.ywwl.com/err-code/download/err-code-1.1.1.tgz","integrity":"sha512-Q73stZ9AKE+M56qqlaD6Zoji5U7Iv2B0Qxgz9ejVVDN1wt0BhwaUPwterzCmD4uVb3T0xPJjWI8uHlPnEHCJkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFVjEBPAG2vg35UNpb3I0RI6PILYDJ/S21sa/9uturqAiEAn8FxXRo3Ta7NZbFrJ2y4ssV2mLpE3me5YWCBlofpA/I="}],"size":2807,"noattachment":false,"key":"/err-code/-/err-code-1.1.1.tgz"},"directories":{},"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":1452740191087,"_cnpm_publish_time":1452740191087,"dist-tags":{"latest":"3.0.1"}}