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
JavaScript (100%)
Total Downloads
4,615,567,637
Last Day
1,589,599
Last Week
28,135,132
Last Month
122,458,155
Last Year
1,323,758,473
ISC License
70 Stars
102 Commits
14 Forks
4 Watchers
19 Branches
9 Contributors
Updated on Jan 21, 2025
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
Published on
Feb 19, 2020
Cumulative downloads
Total Downloads
Last Day
-9.8%
1,589,599
Compared to previous day
Last Week
-8.8%
28,135,132
Compared to previous week
Last Month
3.7%
122,458,155
Compared to previous month
Last Year
30.4%
1,323,758,473
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
42 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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