New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

resclient

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resclient

Resgate client implementing the RES-Client Protocol.

latest
Source
npmnpm
Version
2.5.1
Version published
Weekly downloads
88
-27.27%
Maintainers
1
Weekly downloads
 
Created
Source

Resgate logo

ResClient for Javascript
Synchronize Your Clients

License View on NPM Build Status Coverage

Javascript client library implementing the RES-Client Protocol. Used to establish WebSocket connections to Resgate, to get your data synchronized in real-time.

Visit Resgate.io for more information.

Installation

With npm:

npm install resclient

With yarn:

yarn add resclient

Example usage

import ResClient from 'resclient';

const client = new ResClient('ws://localhost:8080/ws');

client.get('example.mymodel').then(model => {
    console.log(model.message);

    let onChange = () => {
        console.log("New message: " + model.message);
    };

    // Listen to changes for 5 seconds, eventually unsubscribing
    model.on('change', onChange);
    setTimeout(() => {
        model.off('change', onChange);
    }, 5000);
});

Full examples

ExampleDescription
ReactReact client implementation of the Book Collection example.
Vue.jsVue.js client implementation of the Book Collection example.
Vue 3Vue 3 client implementation of the Book Collection example.
ModappBook Collection example from Resgate repository

Note

All examples are complete with both service and client.

Usage in Node.js

To connect with WebSockets in Node.js, we must use a library implementing the WebSocket API, such as isomorphic-ws.

var WebSocket = require('isomorphic-ws');
var ResClient = require('resclient').default;
// Create instance with a WebSocket factory function
var client = new ResClient(() => new WebSocket("ws://localhost:8080"));

Documentation

Markdown documentation

FAQs

Package last updated on 21 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts