{"_id":"simple-errors","_rev":"303840","name":"simple-errors","description":"Errors constructor for simple error handling.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"time":{"modified":"2021-06-03T19:24:52.000Z","created":"2013-01-11T20:35:23.511Z","1.0.1":"2015-03-06T12:17:08.774Z","1.0.0":"2014-11-10T20:08:14.350Z","0.0.5":"2014-07-21T15:26:57.935Z","0.0.4":"2013-02-25T21:35:46.707Z","0.0.3":"2013-01-22T22:43:58.266Z","0.0.2":"2013-01-11T20:45:06.357Z","0.0.1":"2013-01-11T20:35:23.511Z"},"users":{},"author":{"name":"Gustavo Machado"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"versions":{"1.0.1":{"name":"simple-errors","version":"1.0.1","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"istanbul cover _mocha -- -R spec"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*","istanbul":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","dependencies":{"errno":"^0.1.1"},"gitHead":"e596c8a5c7de7a18afb5655f92bd14dc0b0715f0","bugs":{"url":"https://github.com/machadogj/node-simple-errors/issues"},"homepage":"https://github.com/machadogj/node-simple-errors","_id":"simple-errors@1.0.1","_shasum":"b0bbecac1f1082f13b3962894b4a9e88f3a0c9ef","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.35","_npmUser":{"name":"kidozen","email":"development@kidozen.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"dist":{"shasum":"b0bbecac1f1082f13b3962894b4a9e88f3a0c9ef","size":3676,"noattachment":false,"key":"/simple-errors/-/simple-errors-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-1.0.1.tgz"},"directories":{},"publish_time":1425644228774,"_cnpm_publish_time":1425644228774,"_hasShrinkwrap":false},"1.0.0":{"name":"simple-errors","version":"1.0.0","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"istanbul cover _mocha -- -R spec"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*","istanbul":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","gitHead":"ca017fb34276d06f1fb09b7238a82199007ed279","bugs":{"url":"https://github.com/machadogj/node-simple-errors/issues"},"homepage":"https://github.com/machadogj/node-simple-errors","_id":"simple-errors@1.0.0","_shasum":"3d4c9806ca6914400b1a9ce5a927058bc01e3dc5","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.8.28","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"dist":{"shasum":"3d4c9806ca6914400b1a9ce5a927058bc01e3dc5","size":3456,"noattachment":false,"key":"/simple-errors/-/simple-errors-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-1.0.0.tgz"},"directories":{},"publish_time":1415650094350,"_cnpm_publish_time":1415650094350,"_hasShrinkwrap":false},"0.0.5":{"name":"simple-errors","version":"0.0.5","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","bugs":{"url":"https://github.com/machadogj/node-simple-errors/issues"},"homepage":"https://github.com/machadogj/node-simple-errors","_id":"simple-errors@0.0.5","dist":{"shasum":"cd811e213f8c3db13ee47e249f1615c84c31b521","size":2752,"noattachment":false,"key":"/simple-errors/-/simple-errors-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-0.0.5.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{},"publish_time":1405956417935,"_cnpm_publish_time":1405956417935,"_hasShrinkwrap":false},"0.0.4":{"name":"simple-errors","version":"0.0.4","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","readmeFilename":"readme.md","_id":"simple-errors@0.0.4","dist":{"shasum":"073c31261e1d1c7544caf662a3dfe7200cf5fef5","size":2742,"noattachment":false,"key":"/simple-errors/-/simple-errors-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-0.0.4.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{},"publish_time":1361828146707,"_cnpm_publish_time":1361828146707,"_hasShrinkwrap":false},"0.0.3":{"name":"simple-errors","version":"0.0.3","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","readmeFilename":"readme.md","_id":"simple-errors@0.0.3","dist":{"shasum":"59d115551996b980f27594fe5f605928e2486951","size":2006,"noattachment":false,"key":"/simple-errors/-/simple-errors-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-0.0.3.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{},"publish_time":1358894638266,"_cnpm_publish_time":1358894638266,"_hasShrinkwrap":false},"0.0.2":{"name":"simple-errors","version":"0.0.2","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","readmeFilename":"readme.md","_id":"simple-errors@0.0.2","dist":{"shasum":"a653d9bbbb112a2bbcc119bfa279bb931e288ac6","size":1897,"noattachment":false,"key":"/simple-errors/-/simple-errors-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-0.0.2.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{},"publish_time":1357937106357,"_cnpm_publish_time":1357937106357,"_hasShrinkwrap":false},"0.0.1":{"name":"simple-errors","version":"0.0.1","description":"Errors constructor for simple error handling.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"devDependencies":{"mocha":"*"},"keywords":["error"],"author":{"name":"Gustavo Machado"},"license":"BSD","readmeFilename":"readme.md","_id":"simple-errors@0.0.1","dist":{"shasum":"53d5470be03906b2f57b5864ff794cd3e942a70b","size":1864,"noattachment":false,"key":"/simple-errors/-/simple-errors-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/simple-errors/download/simple-errors-0.0.1.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"kidozen","email":"development@kidozen.com"},{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{},"publish_time":1357936523511,"_cnpm_publish_time":1357936523511,"_hasShrinkwrap":false}},"readme":"#simple-errors\nFactory methods for easy error handling.\n\n##Installation\n\n```sh\nnpm install simple-errors\n```\n\n##Usage\nJust make sure to require the module somewhere in your code (only once)\n\n```js\nrequire('simple-errors');\n```\n\nThen use the factory methods for creating errors:\n\n```js\n//simplest of errors\nvar err = Error.create();\n\n//with message\nvar err = Error.create('foo');\nconsole.log(err.message === 'foo'); //prints true\n\n//with data\nvar err = Error.create('foo', { foo: 'bar' });\nconsole.log(err.message === 'foo'); //prints true\nconsole.log(err.foo === 'bar'); //prints true\n\n//with data and inner error\nvar err = Error.create('foo', { foo: 'bar' }, err);\nconsole.log(err.message === 'foo'); //prints true\nconsole.log(err.foo === 'bar'); //prints true\nconsole.log(err.inner === err); //prints true\n\n//helper for status codes (for use with connect & express)\nvar err = Error.http(500);\nconsole.log(err.status === 500); //prints true\n\n//helper for status codes, with message, data and error\nvar err = Error.http(500, 'foo', {foo: 'bar'}, err);\nconsole.log(err.status === 500); //prints true\nconsole.log(err.message === 'foo'); //prints true\nconsole.log(err.foo === 'bar'); //prints true\nconsole.log(err.inner === err); //prints true\n\n//helper method for turning the Error instance into a json object\nvar err = Error.create();\nvar obj = Error.toJson(err); //use this to print the entire error with stack.\n\n```\n","_attachments":{},"homepage":"https://github.com/machadogj/node-simple-errors","bugs":{"url":"https://github.com/machadogj/node-simple-errors/issues"},"license":"BSD"}