Gathering detailed insights and metrics for make-error
Gathering detailed insights and metrics for make-error
Gathering detailed insights and metrics for make-error
Gathering detailed insights and metrics for make-error
npm install make-error
Typescript
Module System
Node Version
NPM Version
98.2
Supply Chain
100
Quality
79.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
4,041,253,893
Last Day
871,639
Last Week
11,684,191
Last Month
90,678,892
Last Year
1,200,462,680
69 Stars
102 Commits
14 Forks
5 Watching
19 Branches
9 Contributors
Minified
Minified + Gzipped
Latest Version
1.3.6
Package Id
make-error@1.3.6
Size
4.33 kB
NPM Version
6.13.4
Node Version
8.17.0
Publised On
19 Feb 2020
Cumulative downloads
Total Downloads
Last day
-13.4%
871,639
Compared to previous day
Last week
-50.1%
11,684,191
Compared to previous week
Last month
-23.7%
90,678,892
Compared to previous month
Last year
25.4%
1,200,462,680
Compared to previous year
Make your own error types!
instanceof
supporterror.name
& error.stack
supporteval()
)Installation of the npm package:
> npm install --save make-error
Then require the package:
1var makeError = require("make-error");
You can directly use the build provided at unpkg.com:
1<script src="https://unpkg.com/make-error@1/dist/make-error.js"></script>
1var CustomError = makeError("CustomError"); 2 3// Parameters are forwarded to the super class (here Error). 4throw new CustomError("a message");
1function CustomError(customValue) { 2 CustomError.super.call(this, "custom error message"); 3 4 this.customValue = customValue; 5} 6makeError(CustomError); 7 8// Feel free to extend the prototype. 9CustomError.prototype.myMethod = function CustomError$myMethod() { 10 console.log("CustomError.myMethod (%s, %s)", this.code, this.message); 11}; 12 13//----- 14 15try { 16 throw new CustomError(42); 17} catch (error) { 18 error.myMethod(); 19}
1var SpecializedError = makeError("SpecializedError", CustomError); 2 3throw new SpecializedError(42);
Best for ES2015+.
1import { BaseError } from "make-error"; 2 3class CustomError extends BaseError { 4 constructor() { 5 super("custom error message"); 6 } 7}
Contributions are very welcomed, either on the documentation or on the code.
You may:
ISC © Julien Fontanet
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/30 approved changesets -- score normalized to 1
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
37 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-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