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

@mangar2/mqttversion

v1.2.2

Published

implements interface adapter version

Downloads

5

Readme

Abstract

Contents

Meta

Global functions

connect

connect (version, options) => {Object}

Creates the objects to connect ot a broker

connect Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | version | string | interface version '1 . 0' or '0 . 0' | | | options | Object | connect options | |

options properties

| Name | Type | Description | | ---------- | ------------ | ----------------- | | clientId | string | unique client identifier | | | host | string | host name of the client host | | | port | number | port number of the clien listening port | | | clean | bool | true , if the connection is cleaned up after disconnect | | | keepAlive | nubmer | keep alive time in milliseconds | |

connect returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , resultCheck ( result ) } |

disconnect

disconnect (clientId) => {Object}

Creates the objects to disconnect from a broker

disconnect Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | clientId | string | unique client identifier | |

disconnect returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , resultCheck ( result ) } |

onConnect

onConnect (headers, payload) => {Object}

Creates the return types for a connect request

onConnect Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | headers | Object | message headers | | | payload | Object | payload to return | |

onConnect returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , statusCode } |

onDisconnect

onDisconnect (headers) => {Object}

creates the return types for a disconnect request

onDisconnect Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | headers | Object | message headers | |

onDisconnect returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , statusCode } |

onPublish

onPublish (headers) => {Object}

creates the return types for a receive message

onPublish Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | headers | Object | input headers | |

onPublish returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , statusCode , packetid } |

onPubrel

onPubrel (headers) => {Object}

Creates the objects for a qos = 2 commit message "pubcomp"

onPubrel Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | headers | Object | pubrel message headers | |

onPubrel returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , statusCode , packetid } |

onSubscribe

onSubscribe (headers, qosArray) => {Object}

Creates the subscribe result objects

onSubscribe Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | headers | Object | input headers | | | qosArray | Array | quality of service reply array | |

onSubscribe returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , statusCode , packetid } |

onUnsubscribe

onUnsubscribe (headers) => {Object}

creates the return types for a disconnect request

onUnsubscribe Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | headers | Object | message headers | |

onUnsubscribe returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , statusCode , packetid } |

publish

publish (version, token, message, qos, dup, retain, packetid) => {Object}

Creates the objects to publish to a client

publish Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | version | string | interface version ( '0 . 0' or '1 . 0' ) | | | token | string | connection token | | | message | Object | payload | | | qos | number | quality of service ( 0 , 1 , 2 ) | | | dup | number | duplicate flag 1 ( true ) or 0 ( false ) . Identifies duplicate packages | | | retain | number | flag 1 ( true ) or 0 ( false ) . Requrests to retain the message | | | packetid | number | unique id of the package | |

publish returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , resultCheck ( result ) } |

pubrel

pubrel (version, token, packetid) => {Object}

creates the return types for a receive pubrel message

pubrel Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | version | string | interface version ( '0 . 0' or '1 . 0' ) | | | token | string | connection token | | | packetid | number | of the packet ( must be the same id as send by publish ! ) | |

pubrel returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , resultCheck ( result ) } |

subscribe

subscribe (version, topics, clientId, packetid) => {Object}

Subscribes to a client

subscribe Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | version | string | interface version ( '0 . 0' or '1 . 0' ) | | | topics | Object | { topic : qos , . . . } | | | clientId | string | unique client identifier | | | packetid | number, undefined | unique id of the package ( not used on version 0 . 0 ) | |

subscribe returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , resultCheck ( result ) } |

unsubscribe

unsubscribe (version, topics, clientId, packetid) => {Object}

Creats the objects to unsubscribe from a client

unsubscribe Parameters

| Name | Type | Description | | ---------- | ------------ | ----------------- | | version | string | interface version ( '0 . 0' or '1 . 0' ) | | | topics | Array | array of topic strings | | | clientId | string | unique client identifier | | | packetid | number, undefined | unique id of the package ( not used on version 0 . 0 ) | |

unsubscribe returns

| Type | Description | | ---- | ----------- | | Object | { headers , payload , resultCheck ( result ) } |