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

ycc-sdk

v1.0.0

Published

Node.js SDK for YCC (Yunxi Camera Communication), N-API addon with bundled ycc library, supports Node.js and Electron

Readme

ycc-sdk

YCC (Yunxi Camera Communication) 的 Node.js SDK:N-API 原生插件 + 捆绑 ycc 动态库,支持 Node.js 与 Electron,无需在编译期链接 ycc。

安装

npm install

发布到 npm 后可使用:npm install ycc-sdk(或你配置的包名)。

快速开始

  • 使用 SDK 内置 ycc 库:无参调用 init() 即可。
const ycc = require('ycc-sdk');
ycc.init();  // 使用 lib/${platform}-${arch}/ 下捆绑的 ycc.dylib / ycc.dll
const handle = ycc.create('192.168.1.1', 8080, (code, data) => { /* 主线程回调 */ });
// ...
ycc.destroy(handle);
  • 使用自定义 ycc 库路径:传入完整路径。
const path = require('path');
ycc.init(path.join(process.env.DLL, 'x86_64', 'ycc.dylib'));
  • 获取默认库路径ycc.getDefaultLibPath() 返回当前平台/架构下 SDK 内捆绑的 ycc 库路径。

支持环境

  • Node.js 14+
  • Electron(需对应 prebuild 或本地 npm run rebuild

API

| 方法 | 说明 | |------|------| | init(libPath?) | 加载 ycc 动态库;不传则用捆绑路径 | | getDefaultLibPath() | 返回捆绑的 ycc 库路径 | | create(host, port, onMessage) | 创建连接,回调在主线程 | | destroy(handle) | 销毁连接 | | disconnect(handle) | 断开连接 | | requestTargetJson(handle, id) | 请求 target JSON | | setTargetInt(handle, id, value) | 设置整型 | | setTargetStr(handle, id, str) | 设置字符串 | | setTargetJson(handle, id, jsonStr) | 设置 JSON | | send(handle, data) | 发送二进制消息 |

目录结构

  • lib/:按平台/架构存放捆绑的 ycc 动态库(darwin-arm64、darwin-x64、win32-x64 等)。Windows:若 ycc.dll 有依赖的其它 DLL,请全部放在同一目录 lib/win32-x64/ 下,会一起打包;加载时 addon 会将该目录加入 DLL 搜索路径。
  • prebuilds/:预编译的 .node 模块(可选);无 prebuild 时会回退到本地 node-gyp build 产物。

构建

npm run build   # node-gyp build
npm run rebuild # node-gyp rebuild(Electron 项目内可配合 electron-rebuild)

打包与发布到 npm

1. 准备发布内容

  • 将各平台的 ycc 动态库放入 lib/ 对应子目录(见 lib/README.md)。
  • Windows:把 ycc.dll 及其所有依赖 DLL 都放进 lib/win32-x64/,会一并被打包、发布。
  • (可选)如需 prebuild,将预编译的 .node 放入 prebuilds/<platform-arch>/

2. 本地打包测试

npm run rebuild   # 编译原生 addon
npm pack          # 生成 ycc-sdk-<version>.tgz

在其它项目中安装测试:

npm install /path/to/ycc-sdk/ycc-sdk-1.0.0.tgz

3. 发布到 npm

# 首次需登录
npm login

# 确认 package.json 中 name、version、files 无误后发布
npm publish
  • 发布时只会包含 package.jsonfiles 所列文件(含 libprebuildsindex.jssrcbinding.gyp 等);用户安装时会执行 npm run rebuild 编译原生模块。
  • 若包名为 scoped(如 @yourorg/ycc-sdk),首次发布需加:npm publish --access public

本 SDK 为独立项目目录,不修改主 Electron 项目逻辑;主项目可继续使用原有 native/ycc-addon,或后续改为依赖本 SDK 包。