1.0.0 • Published 7 years ago

error-replacer v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

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));