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

@activatortube/supernova-sdk

v2.1.7

Published

Client SDK for SuperNova

Downloads

156

Readme

SuperNova SDK项目

基于socket.io实现

Usage

安装

Web

npm install @activatortube/supernova-sdk
# 或者
yarn add @activatortube/supernova-sdk

React Native

  1. 添加依赖
# 1. 添加依赖
npm install @activatortube/supernova-sdk
# 或者
yarn add @activatortube/supernova-sdk
# 2. 添加react-native-get-random-values,比Web需要多一步
yarn add react-native-get-random-values
  1. 安装依赖
npx pod-install
  1. 然后在项目的起始位置引用
import 'react-native-get-random-values';

例子

import 'react-native-get-random-values';
import SuperNova from '@activatortube/supernova-sdk';

const Chat = () => {
  useEffect(() => {
    // 初始化项目
    SuperNova.init(Config.SUPERNOVA_ENDPOINT, 'debug');
    // 登录到聊天服务器
    const instance = SuperNova.getInstance();
    instance.login('', '');
    
    // 添加消息事件
    const messageHandler = (message: Message) => {
      console.log(`收到一条新消息:`, message);
      // TODO
    };
    SuperNova.getInstance().addMessageHandler(messageHandler);
    
    return () => {
      SuperNova.getInstance().removeMessageHandler(messageHandler);
    };
  }, []);
  // TODO
};

文档

API Reference

CHANGELOG

2.1.6 (2024-10-14)

Features

  • 添加删除对话功能 (07c236c) (李伟) (2024-10-14 14:21)

2.1.5 (2024-10-12)

Features

  • 好有信息添加备注字段 (ebbc6fa) (李伟) (2024-10-11 17:43)
  • 聊天会话添加好友详情信息 (ff805db) (李伟) (2024-10-11 17:19)
  • 消息添加创建时间字段 (f41cf35) (李伟) (2024-10-11 16:32)
  • 新增消息发送失败状态 (3e2097e) (李伟) (2024-10-10 14:05)
  • 添加上报推送token功能 (5e13767) (李伟) (2024-09-09 16:12)
  • 添加文件图片发送功能 (2857754) (李伟) (2024-09-05 11:18)
      1. 添加图片文件发送
      1. 可以发送自定义的消息类型

Bug Fixes

  • 修复message对象没有服务端ID错误 (d99001b) (李伟) (2024-08-20 16:03)