errno-codes
Exposes the errno codes for node.js.
Last updated 14 years ago .
MIT · Repository · Original npm · Tarball · package.json
$ npm install errno-codes 
SYNC missed versions from official npm registry.

Node Error

Exposes the errno codes for node.js.

Show me! | Availability | Compatibility | Documentation

Version: 1.0.0

When you are writing a node.js module you'll probably deal with errors. If you get a predefined error you can just resend it 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.

This module eases the error management providing predefined Error instances for every errno code and the ability to create customized errors.

Show me! ↑

var Error = require ("error");

console.log (Error.get (Error.ENOENT));

/*
Prints:

{
	[Error: ENOENT]
	errno: 34,
	code: "ENOENT",
	description: "no such file or directory"
}
*/

Availability ↑

Via npm:

npm install errno-codes

Or simply copying build/error.js into your project's directory and require() accordingly.


Compatibility ↑

✔ Node *


Documentation ↑

Reference
Examples
Change Log
MIT License

Current Tags

  • 1.0.2                                ...           latest (14 years ago)

3 Versions

  • 1.0.2                                ...           14 years ago
  • 1.0.1                                ...           14 years ago
  • 1.0.0                                ...           14 years ago
Maintainers (1)
Downloads
Total 11
Today 0
This Week 1
This Month 8
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE