npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xyadmin-measurement-sdk

v1.0.0

Published

>下载包

Downloads

2

Readme

下载包

npm install xyadmin-sdk

引入包

import Measurement from 'xyadmin-sdk'

初始化

功能描述

  • 创建一个新实例

方法

var measurement = new Measurement(argument)

参数说明

| 参数 | 是否必填 | 描述 | 类型 | |:-------------:|------|:-----------|:------------| | api_url | 是 | API地址 | String | | client_id | 是 | 许可证ID | String | | client_secret | 是 | 许可证 secret | String | | grant_type | 是 | 类型 | String |

示例代码

var measurement = new Measurement(api_url , { client_id, client_secret, grant_type })

创建测量

功能描述

  • 用于开始创建测量

方法

measurement.start(argument)

参数说明

| 参数 | 是否必填 | 说明 | 类型 | |-------|------|:------------------------|:----------| | frame | 是 | 图片 转base64格式 | string |

示例代码

measurement.start(frame)
# 监听创建测量事件 
measurement.addEventListener("created", (measurementId) => {
  # 创建测量成功,返回measurementId
})

发送测量数据

功能描述

  • 用于发送测量帧[必须先创建测量]

方法

measurement.enqueue(argument)

参数说明

| 参数 | 是否必填 | 描述 | 类型 | |-----------|------|:---------------|:--------| | order | 是 | 排序 | Number | | timestamp | 是 | 时间戳 | Number | | frame | 是 | 图片 转base64格式 | string |

示例代码

measurement.enqueue({order, timestamp, frame})
# [监听] 视频传送完成
measurement.addEventListener("finished", () => {
})
# [监听] 阶段性测量结果
measurement.addEventListener("chunkReportProcessed", (result) => {
  # 心率: hrBpm
  const { hrBpm } = result
})
# [监听] 完整报告
measurement.addEventListener("reportProcessed", (result) => {
  const {afReport, bpReport, essentialReport, healthScoreReport, hrReport, riskReport, spo2HReport} = result 
})

中断测量

功能描述

  • 用于主动中断测量(未完成)

方法

measurement.interrupt()

参数说明

示例代码

# 结束测量
measurement.interrupt()

异常失败信息

功能描述

  • 用于监听测量失败信息

方法

measurement.addEventListener('exception', () =>{})

参数说明

示例代码

# 测量失败
measurement.addEventListener('exception', (result) => {
  # 消息详细内容
  const { message } = result
  # 结束发送测量
  measurement.interrupt()
})