Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@todesktop/client-ipc

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@todesktop/client-ipc

Communicating between desktop app windows.

  • 0.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132
increased by193.33%
Maintainers
0
Weekly downloads
 
Created
Source

ToDesktop IPC

Communicating between desktop app windows.

Installation

Install @todesktop/client-ipc in your client-side application using

npm install @todesktop/client-ipc

Installation of the plugin package is also necessary. Using ToDesktop Builder, navigate to Plugins. Click on the Explore button for "Selected Text" and install the package.

Usage

subscribe

Subscribes to a messaging channel and executes a callback when that message is triggered. The callback contains the data and context information from the sender.

You can also unsubscribe from a messaging channel by executing the function that is returned from the initial subscribe call.

import { subscribe } from "@todesktop/client-ipc";

const unsubscribe = subscribe("foo", (data, context) => {
  console.log({ data, context });
  /**
   * {
   * 	data: { msg: "bar" },
   * 	context: { windowId: 2, viewId: 2 }
   * }
   */
});

// ...later
unsubscribe();

publish

Publishes data to a messaging channel.

import { publish } from "@todesktop/client-ipc";

publish("foo", { msg: "bar" });

identify

Retrieves id information about the window and view.

import { identify } from "@todesktop/client-ipc";

async () => {
  console.log(await identify());
  /**
   * {
   * 	windowId: 1,
   * 	viewId: 1
   * }
   */
};

FAQs

Package last updated on 03 Dec 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc