
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@supercharge/errors
Advanced tools
JavaScript error classes with useful defaults
Follow @marcuspoehls and @superchargejs for updates!
The @supercharge/errors package provides error classes with useful defaults. This avoids the boilerplate of setting up a custom error class in different projects.
Error base class capturing the stack trace by defaultname property providing the error’s class nameHttpError class with HTTP status and error code propertiesnpm i @supercharge/errors
Using @supercharge/errors is pretty straightforward. The package exports error classes that you can use like the native Error class.
const { Error, HttpError } = require('@supercharge/errors')
// works like the native `Error` class and also contains the stacktrace
throw new Error('your error message')
// the HTTP Error provides a fluent interface to customize the properties
throw new HttpError('Request validation failed')
.withStatus(400)
.withCode('E_YOUR_CUSTOM_ERROR_CODE')
// or create an HTTP error by passing all arguments to the constructor
throw new HttpError('Request validation failed', 400, 'E_YOUR_CUSTOM_ERROR_CODE')
Do you miss a function? We very much appreciate your contribution! Please send in a pull request 😊
git checkout -b my-featuregit commit -am 'Add some feature'git push origin my-new-featureMIT © Supercharge
superchargejs.com · GitHub @supercharge · Twitter @superchargejs
FAQs
Useful JavaScript error classes
The npm package @supercharge/errors receives a total of 41 weekly downloads. As such, @supercharge/errors popularity was classified as not popular.
We found that @supercharge/errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.