error-replacer

1.0.0 • Public • Published

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

/error-replacer/

    Package Sidebar

    Install

    npm i error-replacer

    Weekly Downloads

    2

    Version

    1.0.0

    License

    Apache-2.0

    Last publish

    Collaborators

    • bchociej