Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
/ error-replacer Public archive

a JSON.stringify replacer to make sense of Error objects

Notifications You must be signed in to change notification settings

juristat/error-replacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

error-replacer

Drop this into the replacer argument in JSON.stringify and you will get meaningful JSON serialization of Error objects.

const errorReplacer = require('error-replacer');

// basicsOnly - say true (default) if you only want Error type and message, no stack or file details
JSON.stringify(something, errorReplacer(basicsOnly));

About

a JSON.stringify replacer to make sense of Error objects

Resources

Stars

Watchers

Forks

Packages

No packages published