Giter Club home page Giter Club logo

neky-err's Introduction

neky-err

Front end anomaly capture.

前端异常捕捉。

    JS异常监控,
    资源异常监控,
    XHR监控,
    轻度可配置化

安装//Install

npm install neky-err --save

ES6

import nekyErr from 'neky-err'

CommonJS

var nekyErr =  require('neky-err');

直接引用//Direct include

<script src="../node_modules/neky-err/src/index.js"></script>

使用方法//Usage

    let nekyError = nekyErr({ 
        url: 'http://localhost:8800/', //接收报错信息地址
        method: 'GET', //请求类型 post/get 默认为post
        isSampling: true, //是否采样,错误信息会存储在本地,同样的错误不会多次发送请求 true / false 默认为true
        addErrData: {}, //附加的数据,该数据会与报错信息一起传给后端,可用于记录一些业务数据
    })

错误数据/errData

    errMsg, //异常信息内容
    errUrl, //异常文件路径
    errIndex, //发生异常的页面
    errType, // 异常类型
    errTime, // 捕捉到异常的时间
    errAgent, // 客户端信息
    errCode, // 错误信息组合的Code,后端可以通过查看这个errCode是否存在, 来确认该报错信息是否需要保存。
    addErrData, // 自定义错误数据,该数据会与报错信息一起传给后端,可用于记录一些业务数据

API

    nekyError.error(err) //接收一个参数为错误信息,可以用于主动监控被捕获的JavaScript异常。

License

MIT

neky-err's People

Contributors

suguangwen avatar

Watchers

 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.