{"name":"create-error-class","version":"1.0.0","description":"Create Error classes","license":"MIT","repository":{"type":"git","url":"https://github.com/floatdrop/create-error-class"},"author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com","url":"github.com/floatdrop"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":[],"dependencies":{"object-assign":"^3.0.0"},"devDependencies":{"mocha":"*"},"gitHead":"07c3b108d16dd8cbd535dafac9549e9bb023e7d5","bugs":{"url":"https://github.com/floatdrop/create-error-class/issues"},"homepage":"https://github.com/floatdrop/create-error-class","_id":"create-error-class@1.0.0","_shasum":"339a476daaa7c0aaf1630af793e55384126c6552","_from":".","_npmVersion":"2.12.1","_nodeVersion":"2.3.4","_npmUser":{"name":"floatdrop","email":"floatdrop@gmail.com"},"dist":{"shasum":"339a476daaa7c0aaf1630af793e55384126c6552","tarball":"http://registry-npm.ywwl.com/create-error-class/download/create-error-class-1.0.0.tgz","integrity":"sha512-jWBBqmTyVaHi/o4e1vUNcxAHlUy97PI0r/Dt2mCrSNI+zGgFnMMvtnqI6CO2rpF9H4nZMWYq7aLphNQFUVvZVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEqXN0Hd0JMlWRulEiWUQFqTKAVla8wtjcMgDqL+OBZwIgAToAwxWX+xT7f2oaU7TfFnwFfRfQ/s30mLwG6Ct6qYw="}],"size":1801,"noattachment":false,"key":"/create-error-class/-/create-error-class-1.0.0.tgz"},"maintainers":[{"name":"floatdrop","email":"floatdrop@gmail.com"}],"directories":{},"readme":"# create-error-class [![Build Status](https://travis-ci.org/floatdrop/create-error-class.svg?branch=master)](https://travis-ci.org/floatdrop/create-error-class)\n\n> Create error class\n\n\n## Install\n\n```\n$ npm install --save create-error-class\n```\n\n\n## Usage\n\n```js\nvar createErrorClass = require('create-error-class');\n\nvar HTTPError = createErrorClass('HTTPError', function (props) {\n\tthis.message = 'Status code is ' + props.statusCode;\n});\n\nthrow new HTTPError({statusCode: 404});\n```\n\n\n## API\n\n### createErrorClass(className, [setup])\n\nReturn constructor of Errors with `className`.\n\n#### className\n\n*Required*  \nType: `string`\n\nClass name of Error Object. Should contain characters from `[0-9a-zA-Z_$]` range.\n\n#### setup\nType: `function`\n\nSetup function, that will be called after each Error object is created from constructor with context of Error object.\n\nBy default `setup` function sets `this.message` as first argument:\n\n```js\nvar MyError = createErrorClass('MyError');\n\nnew MyError('Something gone wrong!').message; // => 'Something gone wrong!'\n```\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n","publish_time":1437320236978,"_cnpm_publish_time":1437320236978,"dist-tags":{"latest":"3.0.2"}}