error-clean-stack

    1.0.2 • Public • Published

    error-clean-stack

    errors with clean stacks

    Install

    npm install --save error-clean-stack
    yarn add error-clean-stack

    Import

    // ES2015
    import cleanErrors from 'error-clean-stack'
    // CommonJS
    var cleanErrors = require('error-clean-stack')

    Errors

    All errors are exported as named exports.

    Error
    ReferenceError
    EvalError
    RangeError
    ReferenceError
    SyntaxError
    TypeError
    URIError

    Example:

    examples/error.js

    const {Error} = require('error-clean-stack')
     
    throw new Error()
    $ node examples/error.js
    C:\xampp\htdocs\error-clean-stack\examples\error.js:5
        throw new Error()
        ^
     
    Error
        at b (C:/xampp/htdocs/error-clean-stack/examples/error.js:5:11)
        at a (C:/xampp/htdocs/error-clean-stack/examples/error.js:7:3)
        at Object.<anonymous> (C:/xampp/htdocs/error-clean-stack/examples/error.js:10:1)

    Contributing

    All pull requests and issues welcome!

    If you're not sure how, check out the great video tutorials on egghead.io!

    License

    MIT © Sam Gluck

    Install

    npm i error-clean-stack

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • sdgluck