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

assetcloud-sdk

v2.1.9

Published

资产云前端SDK

Readme

资产云前端 SDK

Release

旧版文档

  1. 导入和初始化

    导入方式有两种,script标签引入或者npm包引入

    script标签引入

    <script src="dist/sdk.umd.js"></script>
    <script>
    var ac = new ACSDK.SdkClient();
    ac.init().then(function() {
       console.log("SDK已初始化");
    });
    </script>

    npm包引入(推荐)

    import SdkClient from "@assetcloud/asset-sdk";
    // 初始化时可设定超时时间(秒)
    const ac = new SdkClient(5);
    await ac.init();
  2. 监听和发送消息

    处理消息有两种方法,添加事件监听器和直接异步发送消息并等待返回结果。

    直接监听事件&直接发送消息

    支持接收来自平台主动推送的消息。 支持发送没有响应结果的消息。

    ac.addEventListener("GET_USER", e => {
      console.log(e.data.data.userId);
    });
    ac.send("GET_USER");
       

    发送消息并等待返回结果

    返回Promise,如果平台返回值的success字段为false,会自动触发reject。

    try {
      const res = await ac.sendAsync("GET_USER");
      const { userId } = res.data.data;
    } catch (error) {
      console.error(error.data.msg);
    }

    返回结果类型

    AssetCloudEvent<T extends AssetCloudMessage>

前端可用消息

| 功能 | 消息类型 AssetCloudMessage | 请求参数 | 返回结果中data的格式AssetCloudMessageMap[T] | | -- | -- | -- | :--: | | 获取用户 Id | GET_USER | 无 | { userId: string } | | 获取用户账号 | GET_USER_PHONE | 无 | { phone: string } | | 获取当前用户所属集团列表 | GET_GROUP | 无 | { groupIds: object[] } | | 在浏览器打开新的标签页 | OPEN_TAB | 需要打开的url,如:"http://www.baidu.com" | — | | 跳转到平台首页 | GO_HOME | 无 | — | | 跳转到平台待办 | GO_TODO | 无 | — | | 获取当前应用入口菜单 | GET_MENU | 无 | object |