
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
super-errors-json
Advanced tools
Convert a SuperError instance into JSON that is safe for clients.
var Errors = require('super-errors')();
require('super-errors-json')(Errors);
var json = Errors.json(new Errors.NotifyUser('Test...'));
The json variable should now be a string that looks like:
{"name":"NotifyUser","message":"Test...","status_code":500}
The map argument can be used to map where fields go and defaults to:
{
"client_safe_message": 'message',
"errors.client_safe_message": 'errors',
"field": 'field',
"fields.client_safe_message": 'fields',
"name": 'name',
"status_code": 'status_code'
}
This map will give you the name, field, status_code and client_safe_message of the error. All additional errors get converted to strings and placed in an array and fields become an object of fields.
The exclude argument can be used to mark fields you don't want included in resulting object.
FAQs
Convert a SuperError instance into JSON notation safe for clients.
We found that super-errors-json 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.