Gathering detailed insights and metrics for error-utils
Gathering detailed insights and metrics for error-utils
Gathering detailed insights and metrics for error-utils
Gathering detailed insights and metrics for error-utils
npm install error-utils
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
2,251
Last Day
1
Last Week
6
Last Month
13
Last Year
310
1 Stars
5 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Jul 22, 2017
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
error-utils@2.0.0
Size
2.46 kB
NPM Version
5.0.3
Node Version
8.1.3
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
6
Compared to previous week
Last Month
-61.8%
13
Compared to previous month
Last Year
74.2%
310
Compared to previous year
1
In your bash
1npm i -S error-utils
In your code
1const utils = require('error-utils')
func(name) => Error
func(BaseError, name) => Error
func(Error) => Error
Examples:
1// MyError is subclass of Error 2const MyError = makeError('MyError') 3 4// MyError is subclass of TypeError 5const MyError = makeError('MyError', TypeError) 6 7// MyError is subclass of SyntaxError with customized constructor 8const MyError = makeError(class MyError extends SyntaxError { 9 constructor (message, code) { 10 super(message) 11 this.code = code 12 } 13})
func(error, cause) => error
Examples:
1const innerError1 = new InnerError('inner error 1')
2const innerError2 = new InnerError('inner error 2')
3const outerError = new OuterError('outer error')
4
5causedBy(innerError2, innerError1)
6causedBy(outterError, innerError2)
7
8// outerError.cause === innerError2
9// outerError.rootCause === innerError1
10// outerError.ownStack is the original stack of outerError
11// outerError.stack is with stacks of innerError2 and innerError1 appended
func(error) => object
1const error = new MyError('my error') 2const object = errorToObject(error) 3 4// object has name, message, stack, ownStack fields from error 5// object has all other direct fields of error 6// object.cause and object.rootError are parsed from error.cause and error.rootError by errorToObject
func(object, [ErrorClass]) => error
1const error = new MyError('my error') 2const object = errorToObject(error) 3const newError = objectToError(object, MyError) 4 5// newError is instance of MyError 6// newError has name, message, stack, ownStack fields from object 7// newError has all other direct fields of object 8// newError.cause and newError.rootError are parsed from object.cause and object.rootError by objectToError 9// NOTE: newError is no longer instance of MyError
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
56 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More