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

ys7

v1.0.2

Published

萤石云SDK(非官方)

Downloads

2

Readme

萤石云SDK

Install

$ npm i ys7 --save

Usage

初始化

    const YS7 = require('ys7');
    /*
     // 获取到的accessToken有效期是7天,请勿频繁调用,频繁调用将会被拉入限制黑名单。
     获取后应缓存起来,即将过期时重新获取
     {
           accessToken: 'at.6rqp8nh5a8xzl9ah9kcsu8teca8r9gzy-2h67wrzfcq-12zjusw-gbnaksvv8',
           expireTime: 1566186144634
        }
    */
    const token = await YS7.getToken(AppKey, AppSecret); 
    const ys = YS7.init(token.accessToken);
    

添加设备

    // 使用设备序列号和校验码添加摄像头
    const result = await ys.addDevice(deviceSerial, validateCode);

移除设备

    // 使用设备序列号移除摄像头
    const result = await ys.removeDevice(deviceSerial);

AI

    // dateType 数据类型(0:图片URL; 1:base64编码的二进制图片数据)
    // image 图片内容
    // operation 默认仅返回是否有人,可选属性列表: number-返回具体人数, rect-返回检测的人形坐标数据,只能二选一
    const result = await ys.bodyCheck(dataType, image, operation);

摄像头管理

    // 通过设备序列号获取一个摄像头实列
    const camera = ys.getCamera(deviceSerial);

    // 获取直播地址
    // expireTime 可不传,默认最大值  地址过期时间:单位秒数,最大62208000(即720天),最小300(即5分钟)
    // channelNo 可不传,默认为1  通道号,IPC设备填1
    const result = await camera.getLiveAddress(expireTime, channelNo);

    // 获取摄像头信息
    const info = await camera.getInfo();

    // 布撤防,开关摄像头报警功能
    // 具有防护能力设备布撤防状态:0-睡眠,8-在家,16-外出,普通IPC设备布撤防状态:`0-撤防,1-布防
    const result = await camera.defence(isDefence);

    // 抓拍
    const result = await camera.capture();

云台控制

    // 开始控制
    // direction 操作命令:0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下,8-放大,9-缩小,10-近焦距,11-远焦距
    // speed 云台速度:0-慢,1-适中,2-快  // 默认1
    // channelNo 通道号 默认1
    await camera.startCtrl(direction, speed, channelNo);
    

    // 停止控制
    // direction 操作命令:0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下,8-放大,9-缩小,10-近焦距,11-远焦距
    // channelNo 通道号 默认1 
    await camera.stopCtrl(direction, channelNo);

如有你需要使用但本库尚未支持的API,可以提交issues