super-reporter v0.0.1
super-reporter
a JavaScript library, ability to obtain relevant information reported by users
Usage
npm install super-reporter
Documentation
Constructor
interface ReporterOption {
api: string // 接口地址
location: boolean // 使用 pv.sohu.com/cityjson 获取城市,默认 true
global?: Record<string, string> // 自定义公共参数
}
new SuperReport(ReportOption)
const reporter = new SuperReporter({
api: 'http://www.baidu.com/log',
global: {
channel: 'baidu'
}
})
Methods
reporter.send(params: Record<string, string>)
reporter.send({
action: 'test'
})
reporter.getParams();
const params = reporter.getParams()
{
channel: "dev"
payload: "{}"
lang: "zh-CN"
screen_height: 740
screen_width: 360
dpr: 4
host: "172.21.30.252:8080"
href: "http://172.21.30.252:8080/"
referrer: "http://172.21.30.252:8080/"
cpu: "amd64"
device: "mobile"
network: "4g"
model: "SM-G955U"
vendor: "Samsung"
browser_engine: "Blink"
browser_name: "Chrome"
browser_version: "87.0.4280.141"
os_name: "Android"
os_version: "8.0.0"
ua: "Mozilla/5.0 (Linux; Android 8.0.0; SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36"
uuid: "hA3GDXK9K5gl9FaqOY"
}
License
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago