Giter Site home page Giter Site logo

err-replacer's Introduction

err-replacer

JSON stringify replacer to add support for error serialization



Built with ❤︎ by tiaanduplessis and contributors

Table of Contents

Table of Contents
  • Install
  • Usage
  • Contribute
  • License
  • Install

    Greenkeeper badge

    $ npm install err-replacer
    # OR
    $ yarn add err-replacer

    Usage

    const errReplacer = require('err-replacer')
    
    const err = new Error('Foo')
    
    console.log(JSON.stringify(err, errReplacer))
    // {"stack":"Error: Foo\n    at Object.<anonymous> (/Users/Tiaan/Workspace/err-replacer/index.js:16:13)\n    at Module._compile (module.js:569:30)\n
    //  at Object.Module._extensions..js (module.js:580:10)\n    at Module.load (module.js:503:32)\n    at tryModuleLoad (module.js:466:12)\n    at Functio
    // n.Module._load (module.js:458:3)\n    at Function.Module.runMain (module.js:605:10)\n    at startup (bootstrap_node.js:158:16)\n    at bootstrap_nod
    // e.js:575:3","message":"Foo"}
     

    Contributing

    Contributions are welcome!

    1. Fork it.
    2. Create your feature branch: git checkout -b my-new-feature
    3. Commit your changes: git commit -am 'Add some feature'
    4. Push to the branch: git push origin my-new-feature
    5. Submit a pull request :D

    Or open up a issue.

    License

    Licensed under the MIT License.

    err-replacer's People

    Contributors

    greenkeeper[bot] avatar tiaanduplessis avatar

    Watchers

     avatar  avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.