
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
errno-codes
Advanced tools
Node.js project
Show me! | Availability | Compatibility | 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
.
This module eases the error management providing predefined Error
instances for every errno code and the ability to create customized errors.
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" }
*/
Via npm:
npm install errno-codes
✔ Node *
FAQs
Exposes the errno codes.
The npm package errno-codes receives a total of 538 weekly downloads. As such, errno-codes popularity was classified as not popular.
We found that errno-codes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.