{"_id":"simple-errors","_rev":"22-8895b88fc4c5c233d3732bb5cf27729a","name":"simple-errors","description":"Errors constructor for simple error handling.","dist-tags":{"latest":"1.0.1"},"versions":{"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","_id":"simple-errors@0.0.1","dist":{"shasum":"53d5470be03906b2f57b5864ff794cd3e942a70b","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-0.0.1.tgz","integrity":"sha512-Y6pgZPGquw5oF8+gY06ihJdyK/JI6aHcNMKQ/ZAovsuLu8WrMEi3NJUfSpauV1BmkVtv5ogYKiUlIT9hRkjl8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBgnKYi1HgDPQz6rJmgctUIRsBGx/lqv1QEwQocP5PYQIhAOAu4hHbWMVZEkkA6QiEICZYbJp1O0xm72w3Lymud2o8"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{}},"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","_id":"simple-errors@0.0.2","dist":{"shasum":"a653d9bbbb112a2bbcc119bfa279bb931e288ac6","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-0.0.2.tgz","integrity":"sha512-VjENwFxMcO4lyl6eSl+YpJ9MqbI3zTIONSP2u5mlGuRMa8fRDL1h5MfFWZK65mOS1nOFYeU7LUb5tLi3wOgrng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmCknbzOhXBH+f5t4JxbjBqhkC9cehYS9Z9L/ffa/TPAiBCvXWD780VuEt6/h3gJzcTIbytXXL1Wj9wJzKg5wHZIg=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"machadogj","email":"machadogj@gmail.com"}],"directories":{}},"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","_id":"simple-errors@0.0.3","dist":{"shasum":"59d115551996b980f27594fe5f605928e2486951","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-0.0.3.tgz","integrity":"sha512-Vr6l3XFPLg1FAxEGDlaOkxsZc5vWLxassTRnA9XSWrzqD5Sj4z72AMXdXwXqhEI79sjDFm7uf2a2UzlUMsZVSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1Zvnh3gmiRYznFux+ruzQU6MO4RI7+3/SmXcu7lEe/gIgKY/OElmKX9uRoOLjnN3Ks2FD4kQIhRkqBeTK0iR1GSQ="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"machadogj","email":"machadogj@gmail.com"}]},"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","_id":"simple-errors@0.0.4","dist":{"shasum":"073c31261e1d1c7544caf662a3dfe7200cf5fef5","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-0.0.4.tgz","integrity":"sha512-IE9vzHzoesrbB7Wi06tVcbPIjQ8sYTDEWrnQHVLlRY8X43CO1hFNaN0OsyvHtVpXaK/GqA/zEJdBeoTCZ6BMuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJEbzVAJaKY8Ocq1+jSadi9SmyGlZViLiBT7fv6XXTBAiEAymKaQkA3OIpUtB4RgjUeBdQXHrpv5WxyoLo6HSy21wE="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"machadogj","email":"machadogj@gmail.com"}]},"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","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-0.0.5.tgz","integrity":"sha512-9qXuK7nRzlRYa88sWWUisRExxuWOhEezlsWLPVWsrrYe+tZsOuulx4oXchDSKhO9GYBLAmLsbqMdvEGqbyc8YA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDoL2O2Af19sQ3h+jb90IuEB8/uHvqj/OFvqXTtB6u/2AiEAvf8RuBe6yj84H4xju3t9yo9MF49rTgXsywLL48t3ruA="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"machadogj","email":"machadogj@gmail.com"},"maintainers":[{"name":"machadogj","email":"machadogj@gmail.com"}]},"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":"machadogj","email":"machadogj@gmail.com"}],"dist":{"shasum":"3d4c9806ca6914400b1a9ce5a927058bc01e3dc5","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-1.0.0.tgz","integrity":"sha512-BRXuotSTOn4bUhf8kHY4x3FycXkbYMyyCoo9etM9w2Z8r4oeLhy1Qz2yOCC/BiEZley1oRrUzwtjXK/F4j+gzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDF56pGJcNR5O3G/6+wemx2Bq4SaLJ8lepmqWK7PR3NHgIgVoNsY1ED/4XD+19N1jDvLgAEYIGHaXiotAJAkxWClDY="}]}},"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":"machadogj","email":"machadogj@gmail.com"},{"name":"kidozen","email":"development@kidozen.com"}],"dist":{"shasum":"b0bbecac1f1082f13b3962894b4a9e88f3a0c9ef","tarball":"https://registry.npmjs.org/simple-errors/-/simple-errors-1.0.1.tgz","integrity":"sha512-OdTm4rfntYfxgS4RwrUurrpBdZT50tWAjsx93H/YcODJRFDwVEzIPPPiKhgIbSKyLsIMcB/FnBVCmb5lWHr9NQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgv3g+L05h8sBm7QekYNA6KoiUu/i9Tws5ZCtjhoWo6wIhAMlEHQlCmgHOYWXqS1FhSK+uZa5Y1XEtClfMKF5EiDpX"}]}}},"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","maintainers":[{"name":"machadogj","email":"machadogj@gmail.com"},{"name":"kidozen","email":"development@kidozen.com"}],"time":{"modified":"2022-06-26T19:36:53.242Z","created":"2013-01-11T20:35:21.163Z","0.0.1":"2013-01-11T20:35:23.511Z","0.0.2":"2013-01-11T20:45:06.357Z","0.0.3":"2013-01-22T22:43:58.266Z","0.0.4":"2013-02-25T21:35:46.707Z","0.0.5":"2014-07-21T15:26:57.935Z","1.0.0":"2014-11-10T20:08:14.350Z","1.0.1":"2015-03-06T12:17:08.774Z"},"author":{"name":"Gustavo Machado"},"repository":{"type":"git","url":"https://github.com/machadogj/node-simple-errors.git"},"homepage":"https://github.com/machadogj/node-simple-errors","keywords":["error"],"bugs":{"url":"https://github.com/machadogj/node-simple-errors/issues"},"license":"BSD","readmeFilename":"readme.md"}