0.0.16 • Published 9 months ago

@heimdallr-sdk/node v0.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@heimdallr-sdk/node

English

NodeJs监控基座,内置错误捕获sdk

可捕获错误类型

  • 未捕获的错误

默认使用 get 上报,允许自定义请求函数

Options

配置名称类型描述可选值默认值
dsnObject上报接口配置信息DSN-
appObject应用信息APPInfo-
enabledBoolean是否向后台发送事件true/falsetrue
pluginsArray插件集合--
debugBoolean控制台是否显示sdk输出信息true/falsefalse
sendFuncFunction请求函数--

DSN

名称类型描述可选值
hostString上报接口域名地址-
initString应用初始化接口地址-
reportString信息上报接口地址-

APPInfo

名称类型描述可选值
nameString应用名称-
leaderString负责人-
descString应用描述-

sendFunc

|参数|类型|描述| |url|string|请求地址| |params|Object|上报参数|

sendFunc 将会返回一个 Promise 实例

const heimdallerOptions = {
    dsn: {
        host: 'http://localhost:8888',
        init: '/project/init',
        report: '/log/report'
    },
    app: {
        name: 'playgroundAPP',
        leader: 'test',
        desc: 'test proj'
    },
    sendFunc: (url, params) => {
        return new Promise((rs, rj) => {
            // do something
            rs({
                code: 0,
                msg: 'success',
                data: 'hello world'
            });
        })
    }
}

Usage

import heimdallr from "@heimdallr-sdk/node";
heimdallr({
    dsn: {
        host: 'http://localhost:8888',
        init: '/project/init',
        report: '/log/report'
    },
    app: {
        name: 'playgroundAPP',
        leader: 'test',
        desc: 'test proj'
    }
});
0.0.16

9 months ago

0.0.15

9 months ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.12

1 year ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago