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

kang-customer-service

v1.0.0

Published

This is a online realtime customer-service system, provides customer endpoint api and service endpoint api, allow customers to communicate with services in both directions.

Downloads

12

Readme

在线客服系统-服务器端

一个在线客服系统应该包括以下4个端:

  • 服务器端
  • 客户端
  • 客服端
  • 管理平台

服务器端用于提供各平台的通信服务 API。

服务器端

启动服务器

npm start

客户端 API

客户端 API 需要引入 api/customer.js 文件

方法

构造函数 Customer

实例化一个客户端

send(msg, to)

发送消息

  • msg: string 要发送的消息
  • to: string 接收者的ID

request(customer)

事件

| 事件 | 参数 | 说明 | |---- |--- |--- | | onConnected | {id: 分配的Socket ID} | 连接到服务器 | | onDisconnect | 无 | 断开连接 | | onMessage | {from: string 发送者的ID, msg: string 内容} | 收到消息 | | onInputing | {id: string 客户ID} | 对方正在输入 | | onResponse | {service: string 客服ID} | 客服接入 |

客服端 API

客服端 API 需要引入 api/service.js 文件

方法

构造函数 Service

实例化一个客服端

login(uid, pwd)

登录

  • uid: string 用户名
  • pwd: string 密码

返回:promise 用户信息 {id: string, name: string, sex: number}

response(customer)

响应客户请求 客服端接入客户

  • customer: string 客户ID

getRequests()

获取当前正在等待响应的客户

返回:promise 当前正在等待响应的客户 string[]

事件

| 事件 | 参数 | 说明 | |---- |--- |--- | | onConnected | {id: 分配的Socket ID} | 连接到服务器 | | onDisconnect | 无 | 断开连接 | | onMessage | {from: string 发送者的ID, msg: string 内容} | 收到消息 | | onInputing | {id: string 客户ID} | 对方正在输入 | | onRequest | {id: string 客户ID} | 有新客户接入 | | onResponse | {service: string 客服ID, customer: string 客户ID} | 客服已被接入 |