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

@lucahealthcare/luca-core-ts

v1.0.1519

Published

Luca Core for TypeScript

Readme

luca-core-ts

用于 Luca 相关核心功能的 TypeScript 库。

包含功能

DBM 相关实现

  • 网络实现
    • 加密
    • 加签
    • 解密
  • 对接 Luca OpenAPI 实现模块相关功能
  • 模块数据上传到 MinIO 的实现

包内使用相关域名

  • minio-helper.lucahealthcare.cn
  • dbm.lucahealthcare.cn (多环境)
  • open.lucahealthcare.cn (多环境)

使用方法

安装依赖:

npm install luca-core-ts --save --registry=https://npm.lucahealthcare.cn/

导入模块以及初始化:

import { LucaCore } from "luca-core-ts";
LucaCore.instance.initialize({
  env: "dev", // 环境变量,如 dev, test, uat, prod
  dbmKeys: {
    privateKey: "<your private key>", // 开发方提供的私钥,用于数据加签
    publicKey: "<your public key>", // Luca提供的公钥,用于数据加密
  },
  request: config => {
    /**
     * 这里要根据开发使用的网路框架进行配置,返回一个Promise<Data>对象, Data为response.data
     */
    const { url, method, headers, data, params, cache } = config;

    // 如果使用Taro
    return Taro.request({...})

    // 如果使用axios
    return axios.request({...})
  },
  uploadFile: (config, callbacks) => {
    // 这里要根据开发使用的网路框架进行配置
    const { url, filePath, name, formData, headers } = config;

    // 当上传文件时,执行回调函数,如:onSuccess, onFail, onProgress
    const {onSuccess, onFail, onProgress} = callbacks;

    // 如果使用Taro
    return Taro.uploadFile({...})

    // 如果使用axios
    return axios.post({...})
  },
});

DBMEvent 使用

import { LucaCore, DBMEvent } from "luca-core-ts";

// 创建一个DBMEvent实例,传入一个DBMT对象作为参数。这意味着开始测试
const dbmEvent = DBMEvent.create(dbmt);

// 设置个人信息,比如身高、年龄等
dbmEvent.putProfileJson({...})

// 产生了一些文件数据,如音视频文件
dbmEvent.uploadFromFilePath([...])

// 产生数据后,设置输入数据
dbmEvent.putInputJson({...});

// 结束测试并且完成文件上传以后调用notifyFinish方法。这会触发DBMEvent的结束事件,然后关闭所有相关的资源。
dbmEvent.notifyFinish();

// 轮询等待结果, 当有结果的时候意味着事件结束了
const {isCancel} = await dbmEvent.waitForResult(()=>{
  return false; // 外部可以决定是否手动退出等待
}, {
  network: {
    delayThresholdMs: 1000, // 网络延迟阈值,超过这个时间则认为网络不稳定
    delayCallback: () => void // 网络不稳定时的回调函数
  }
}); // isCancel true 表示取消了,false表示正常结束。