{"dist":{"shasum":"3e2cf56b888dd7200c4367ffc0a7d007be30c7b4","tarball":"https://registry.npmjs.org/errno-codes/-/errno-codes-1.0.2.tgz","integrity":"sha512-sckYVUjldnLSno8aS/OxlRl/rPmoy9H+fvsxq8LIn7qn/XD/HZnScbRX2/evF8oUJ9LEpu9wL3QTybiHpdVevg==","signatures":[{"sig":"MEUCIQCYjMiuSMDt4Qw8R5UEwXIfKimJ4+3scUC0VSHodApW/wIgOJkHEasfF82imbL66Yh/ydFuZ9zZTc6DdNFQS9LSXbE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"error","name":"errno-codes","author":{"name":"Gabriel Llamas"},"readme":"<a name=\"start\"></a>\r\n\r\nNode Error\r\n==========\r\n\r\n_Node.js project_\r\n\r\n#### Exposes the errno codes ####\r\n\r\n[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)\r\n\r\nVersion: 1.0.2\r\n\r\nWhen you are writing a node.js module you\"ll probably deal with errors. If you get a predefined error you can just throw it via a callback but if you want to instantiate a predefined one you need an errno code. Node.js does not expose these errors. Furthermore, they\"re not the standard errno codes. They are defined at [`deps/uv/include/uv.h`](https://github.com/joyent/node/blob/master/deps/uv/include/uv.h).\r\n\r\nThis module eases the error management providing predefined `Error` instances for every errno code and the ability to create customized errors.\r\n\r\n<a name=\"showme\"></a>\r\n#### Show me! [↑](#start) ####\r\n\r\n```javascript\r\nvar Error = require (\"errno-codes\");\r\n\r\nconsole.log (Error.get (Error.ENOENT));\r\n\r\nvar errno = Error.getNextAvailableErrno ();\r\nError.create (errno, \"TEST1\", \"test 1\");\r\nconsole.log (Error.get (Error.TEST1));\r\nconsole.log (Error.get (\"TEST1\"));\r\nconsole.log (Error.get (errno));\r\n\r\n/*\r\nPrints:\r\n\r\n{ [Error: ENOENT]\r\n  errno: 34,\r\n  code: \"ENOENT\",\r\n  description: \"no such file or directory\" }\r\n{ [Error: TEST1] errno: 100, code: \"TEST1\", description: \"test 1\" }\r\n{ [Error: TEST1] errno: 100, code: \"TEST1\", description: \"test 1\" }\r\n{ [Error: TEST1] errno: 100, code: \"TEST1\", description: \"test 1\" }\r\n*/\r\n```\r\n\r\n***\r\n\r\n<a name=\"availability\"></a>\r\n#### Availability [↑](#start) ####\r\n\r\nVia npm:\r\n\r\n```\r\nnpm install errno-codes\r\n```\r\n\r\n***\r\n\r\n<a name=\"compatibility\"></a>\r\n#### Compatibility [↑](#start) ####\r\n\r\n✔ Node *\r\n\r\n***\r\n\r\n<a name=\"documentation\"></a>\r\n#### Documentation [↑](#start) ####\r\n \r\n[Reference](https://github.com/Gagle/Node-Error/wiki/Reference)  \r\n[Examples](https://github.com/Gagle/Node-Error/tree/master/examples)  \r\n[Change Log](https://github.com/Gagle/Node-Error/wiki/Change-Log)  \r\n[MIT License](https://github.com/Gagle/Node-Error/blob/master/LICENSE)","engines":{"node":"*"},"_npmUser":{"name":"Gagle","email":"gaglekas@gmail.com"},"keywords":["error","errno"],"licenses":[{"url":"http://www.opensource.org/licenses/mit-license.html","type":"MIT"}],"repository":{"url":"git://github.com/Gagle/Node-Error.git","type":"git"},"_npmVersion":"1.1.62","description":"Exposes the errno codes.","maintainers":[{"name":"Gagle","email":"gaglekas@gmail.com"}],"_id":"errno-codes@1.0.2","version":"1.0.2"}