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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ctiot-api-client

v1.0.0

Published

This main purpose of the module is to connect China Telecom's IoT platform.

Downloads

4

Readme

中国电信物联网平台接口客户端

功能

该客户端主要用于连接中国电信物联网 API。

使用方式

接口发生错误

有很多种情况会导致接口发生错误,例如调用接口的用户名密码错误、参数错误、当前卡片状态不支持该操作等。因为运营商接口返回值不可预测,凡是没有得到正确格式的返回值,全部抛出错误,错误的内容就是接口全部返回值。共有以下几种错误场景:

网络错误

表现: 原因:

  • 运行主程序的网络环境异常; 处理方式:捕捉到异常之后,直接将异常抛出,由主程序处理

参数错误

原因:

  • 用户名、密码、密钥等关键基础信息错误;
  • 调用具体方法时提供的参数错误; 表现:
  • 接口会返回 -1/-2/-3 等文本格式而不是 xml 格式的信息;
  • 接口会返回 html 格式的信息;
  • 接口会返回 xml 格式但不是预期的信息,比如部分节点和预期的节点的值或者结构不同; 处理方式:

运营商远程服务器错误

原因:

  • 远程服务器故障; 表现:
  • 远程服务器无响应;
  • 返回值不是正确的格式 处理方式:

日志记录

因为运营商的接口经常出现问题。为了方便对非查询类即操作类接口办理的业务结果进行审计,只要是非查询类接口访问的结果全部记录日志。

  • 能够正确转换为 json 格式的响应结果,直接打印转换后的 json 格式;
  • 不能正确转换为 json 格式的,例如字符串、html 等格式,直接打印原始格式;

日志的默认保存路径和文件名是在 ./logs/operator-ctcc.log