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

socket-conveyor-client

v1.2.6

Published

A client for the php package kanata-php/socket-conveyor

Downloads

5

Readme

A client for the php package kanata-php/socket-conveyor

🏠 Homepage

Prerequisites

  • npm >=5.5.0
  • node >=9.3.0

Install

npm install socket-conveyor-client

Description

This is a client for the Socket Conveyor PHP package..

Usage

To use this package, once it is installed, the following example shows how it works.

<div>
    <div><button onclick="connection.send('base', 'base-action')">Base Action</button></div>
    <div><button onclick="connection.send('first', 'example-first-action')">First Action</button></div>
    <div><button onclick="connection.send('second', 'example-second-action')">Second Action</button></div>
    <div id="output"></div>
</div>
<script type="module" type="text/javascript">

    // if this connection happens on a bundle, use it like this: import Conveyor from 'socket-conveyor-client';
    import Conveyor from './node_modules/socket-conveyor-client/index.js';

    var connection = new Conveyor({
        channel: 'actions-channel',
        listen: ['example-first-action'],
        onMessage: (e) => {
            document.getElementById('output').innerHTML = e;
        },
        onReady: () => {
            connection.send('Welcome!');
        },
    });

</script>

With the previous example your html client will try to connect to ws://127.0.0.1:8000. This client will connect to the channel actions-channel, and will listen to example-first-action actions. That said, any message sent to that channel and action, will be received at the OnMessage callback.

Options

protocol: 'ws',
uri: '127.0.0.1',
port: 8000,

// Url query for connection.
query: '',

channel: null,
listen: null,
onOpen: this.onOpen.bind(this),
onReady: () => {},

// Message handler for only the data portion.
onMessage: () => {},

// Message handler for the whole incoming object.
onRawMessage: () => {},

// Callback triggered when closing connection. If overwritten the reconnection feature can be affected. 
onClose: () => this.onClose.bind(this),

// Callback for securely do something when connection is closed, without affecting default closing connection behavior.
onCloseCallback: () => {},

// Callback for reconnection feature. Useful if you need to renew a token before attempting again. You might also want to check the method `setOption` for this, so you can change options during this procedure.
onReconnectCallback: () => {},

onError: () => {},

// Settings for reconnection feature.
reconnect: false,
reconnectDelay: 5000,

// Interval for connection verification, so reconnection action can take place if reconnection active.
healthCheckInterval: 3000,

// Interval for connection heartbeat, so connection can be kept alive.
heartBeat: true,
heartBeatInterval: 10000,

Author

👤 Savio Resende

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Savio Resende.