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

@ctsy/ctwing-sdk

v2.0.3

Published

```typescript import { ctwing } from "./index"; (async () => { let ProductID = 10022900; let appKey = ""; let appSecret = ""; let MasterKey = ""; let DeviceID = ""; let device = new ctwing.Device(ProductID); device.appKey = appKey; device.MasterKey = Mast

Downloads

19

Readme

中国电信 物联网平台 AEP 平台 www.ctwing.cn NodejsApi

import { ctwing } from "./index";
(async () => {
  let ProductID = 10022900;
  let appKey = "";
  let appSecret = "";
  let MasterKey = "";
  let DeviceID = "";
  let device = new ctwing.Device(ProductID);
  device.appKey = appKey;
  device.MasterKey = MasterKey;
  device.appSecret = appSecret;
  let sub = new ctwing.Subscriptions(ProductID);
  sub.appKey = appKey;
  sub.MasterKey = MasterKey;
  sub.appSecret = appSecret;
  let data = new ctwing.Data(ProductID);
  data.appKey = appKey;
  data.MasterKey = MasterKey;
  data.appSecret = appSecret;
  let com = new ctwing.Command(DeviceID);
  com.appKey = appKey;
  com.MasterKey = MasterKey;
  com.appSecret = appSecret;
  try {
    let rs = await device.Create(
      "we7658e729c74c01a79fa46a6",
      "test1001test",
      "YYY",
      {}
    );
    rs = await device.Delete("we7658e729c74c01a79fa46a694eaff1");
    rs = await device.Update(
      "67fde26edb074611aabdb870872b3b22",
      "test1001test11",
      "YYY",
      {}
    );
    rs = await device.Query("be7658e729c74c01a79fa46a694eaff1");
    rs = await device.Query("67fde26edb074611aabdb870872b3b22");
    rs = await device.QueryList("");
    // --------- 设备订阅操作---------------------
    rs = await sub.Create(
      "67fde26edb074611aabdb870872b3b22",
      2,
      "YYY",
      "www.baidu.com",
      [1]
    );
    rs = await sub.Delete("be7658e729c74c01a79fa46a694eaff1", 1, 1);
    rs = await sub.Query(10022900);
    rs = await sub.QueryList(1, 10, 1);
    // --------- 数据状态查询---------------------
    rs = await data.QueryPage(
      "2d5750603d28403d85b784a852ed24c6",
      5,
      "1571456132140",
      JSON.stringify(Date.now())
    );
    rs = await data.QueryTotal(
      "2d5750603d28403d85b784a852ed24c6",
      "1571456132140",
      JSON.stringify(Date.now())
    );
    rs = await data.Query("2d5750603d28403d85b784a852ed24c6", "temperature");
    rs = await data.QueryList("2d5750603d28403d85b784a852ed24c6");
    // ----------设备指令操作---------
    rs = await com.send(Buffer.from("0102", "hex"));
    rs = await com.Cancel("2");
    rs = await com.query("2");
    rs = await com.queryList();
  } catch (error) {
    console.log(error.message);
  }
})();