ipcclient-js
v0.2.2
Published
This is a simple IPC client for JavaScript. It is designed to work with the IPC server in the [ipcserver](https://github.com/class-undefined/ipcserver.git)
Downloads
330
Readme
ipcclient-js
This is a simple IPC client for JavaScript. It is designed to work with the IPC server in the ipcserver
Usage
import { IpcClient } from 'ipcclient';
IpcClient.connect('/path/to/foo.sock', async (client) => {
const response = await client.send<string>("/hello", 'Hello, World!')
console.log(response) // IpcResponse<string> { data: 'Hello, World!', code: 200, message: '处理成功' }
});
Handling Error: crypto.getRandomValues() not supported on node.js
If you encounter the error Error: crypto.getRandomValues() not supported on node.js
while running your Node.js application, it indicates that the crypto.getRandomValues()
method is not available in your current Node.js environment.
To resolve this issue, you can install the polyfill-crypto-methods
package, which provides a polyfill for the crypto.getRandomValues()
method.
Steps to Install the Polyfill
Install the
polyfill-crypto-methods
package using npm or yarn:npm install polyfill-crypto-methods
Import and apply the polyfill in your code before you use any functionality that requires the
crypto.getRandomValues()
method:import 'polyfill-crypto-methods'