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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cutos-sdk

v2.0.5

Published

cutos相关api二次封装

Readme

Cutos 设备 SDK

该 SDK 提供了与多种医疗设备的接口,包括身份证读卡器、温度计、身高/体重秤、血压监测仪和打印机。以下是初始化和使用这些设备的步骤和函数说明。

前提条件

需要在本地安装cutos客户端,详情可参考:https://sharing8.yuque.com/sharing8/mc3wxx/yrfxsy71pd0p9gs8

使用方法

1. 初始化

await initCoreApi(host, devicesPortConfig); host: cutos本地客户端的地址, 实机上面是null。 devicesPortConfig: 一个对象,映射设备类型到其对应的 COM 端口。

devicesPortConfig参数说明:

temp: 温度计所使用的 COM 端口编号,通常是一个整数,例如 4。 heightWeight: 身高体重秤所使用的 COM 端口编号,通常是一个整数,例如 2。 bp: 血压监测仪所使用的 COM 端口编号,通常是一个整数,例如 10。

2.方法调用

  1. 身份证读卡器:
import { readCard } from 'cutos-SDK'
readCard((cardinfo) => {
  console.log(cardinfo, 'cardinfo')
})
  1. 温度计:
import { fetchTempData } from 'cutos-SDK'
fetchTempData()
  .then((res) => {
    console.log(res, 'res')
  })
  .catch((err) => {
    console.log(err, 'err')
  })
  1. 身高体重秤:
import { fetchHeightWeightData } from 'cutos-SDK'
fetchHeightWeightData()
  .then((res) => {
    console.log(res, 'res')
  })
  .catch((err) => {
    console.log(err, 'err')
  })
  1. 血压监测仪:
import { fetchBpData } from 'cutos-SDK'
fetchBpData()
  .then((res) => {
    console.log(res, 'res')
  })
  .catch((err) => {
    console.log(err, 'err')
  })
  1. 打印机:
import { toPrint } from 'cutos-SDK'
toPrint('打印文件url', '打印机名称', '打印成功回调函数', '打印失败回调函数')
  1. 设置接口代理
import { setProxy } from 'cutos-SDK'
setProxy('apiProxy', 'http://127.0.0.1:8888')
  1. 获取二维码扫描结果
import { getQrCodeData } from 'cutos-SDK'
getQrCodeData().then((res) => {
  console.log('res', res)
})