# errno-codes

> Exposes the errno codes.

Latest version **1.0.2** (published 2012-10-09) · 0 weekly downloads

## Install

```sh
npm install errno-codes
pnpm add errno-codes
yarn add errno-codes
bun add errno-codes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2012-10-09 |
| First published | 2012-08-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gabriel Llamas |
| Maintainers | Gagle |
| Keywords | error, errno |

## Links

- npm: https://www.npmjs.com/package/errno-codes
- Repository: https://github.com/Gagle/Node-Error
- npm.io page: https://npm.io/package/errno-codes

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2012-10-09
- 1.0.1 — 2012-10-09
- 1.0.0 — 2012-08-04

## README

<a name="start"></a>

Node Error
==========

_Node.js project_

#### Exposes the errno codes ####

[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)

Version: 1.0.2

When 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).

This module eases the error management providing predefined `Error` instances for every errno code and the ability to create customized errors.

<a name="showme"></a>
#### Show me! [↑](#start) ####

```javascript
var Error = require ("errno-codes");

console.log (Error.get (Error.ENOENT));

var errno = Error.getNextAvailableErrno ();
Error.create (errno, "TEST1", "test 1");
console.log (Error.get (Error.TEST1));
console.log (Error.get ("TEST1"));
console.log (Error.get (errno));

/*
Prints:

{ [Error: ENOENT]
  errno: 34,
  code: "ENOENT",
  description: "no such file or directory" }
{ [Error: TEST1] errno: 100, code: "TEST1", description: "test 1" }
{ [Error: TEST1] errno: 100, code: "TEST1", description: "test 1" }
{ [Error: TEST1] errno: 100, code: "TEST1", description: "test 1" }
*/
```

***

<a name="availability"></a>
#### Availability [↑](#start) ####

Via npm:

```
npm install errno-codes
```

***

<a name="compatibility"></a>
#### Compatibility [↑](#start) ####

✔ Node *

***

<a name="documentation"></a>
#### Documentation [↑](#start) ####
 
[Reference](https://github.com/Gagle/Node-Error/wiki/Reference)  
[Examples](https://github.com/Gagle/Node-Error/tree/master/examples)  
[Change Log](https://github.com/Gagle/Node-Error/wiki/Change-Log)  
[MIT License](https://github.com/Gagle/Node-Error/blob/master/LICENSE)

---
_Source: https://npm.io/package/errno-codes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
