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

vue-stomp-ds

v1.0.12

Published

A Vue.js project user stomp protocol

Downloads

8

Readme

vue-stomp-ds

vue stomp 协议客户端需要配合http://10.168.4.20:8099/daoshu/public-architecture.git 中public-architecture/common-platform/platform/daoshu-message后端一起使用

使用帮助

下载

npm install vue-stomp-ds -S

使用

1.在main.js中引入vue-stomp-ds,例如:

import VueStomp from 'vue-stomp-ds'

Vue.use(VueStomp, 'http://localhost:9050/msg-websocket')

2.在需要引入stomp的组件中直接使用vue-stomp-ds,方法:

connectWM

参数:

  • [Endpoint]:websocket的链接地址
  • [Header]:链接参数
  • [callback]:链接成功回调函数
  • [errorCallback]: 失败回调函数

用法:

this.connetWM('http://localhost:9050/msg-websocket?userId=01', headers, this.onConnected, this.onFailed);    

subscribe

参数:

  • [destination]:订阅地址
  • [callback]:订阅成功回调函数
  • [errorCallback]: 订阅回调函数

用法:

this.$stompClient.subscribe('/topic/username', this.responseCallback, this.onFailed);

sendWM

参数:

  • [destination]:发送地址
  • [msg]:发送内容
  • [invokeId]: 唯一编号
  • [callback]: 发送成功回调
  • [timeOut]: 过期时间

用法:

this.sendWM(destination, JSON.stringify(body), invokeId, this.responseCallback, 3000);

sendToUser

参数:

  • [user]:发送对象ID
  • [msg]:发送内容
  • [invokeId]: 唯一编号
  • [callback]: 发送成功回调
  • [timeOut]: 过期时间

用法:

this.sendToUser(user, JSON.stringify(body), invokeId, this.responseCallback, 3000);

stompClient

参数:

  • [monitorIntervalTime]:监视轮询时间设置
  • [stompReconnect]:是否重连
  • [timeout]: 超时回调
  • [reconnectTimes]: 每次重试次数
  • [reconnectIntervalTime]: 重连间隔

用法:

export default {
    name: 'App',
    mounted() {
    },
    stompClient: {
      monitorIntervalTime: 1000,
      stompReconnect: true,
      timeout(orgCmd) {
      	console.log('orgCmd', orgCmd)
      },
      reconnectTimes: 10,
      reconnectIntervalTime: 30000
    }
}