This commit is contained in:
2025-08-23 11:29:22 +00:00
parent 92cbc4e543
commit 234aab74d6
16 changed files with 10068 additions and 2037 deletions

View File

@@ -1,7 +1,9 @@
# @push.rocks/smartipc
node inter process communication
## Install
To install @push.rocks/smartipc, use the following command with npm:
```bash
@@ -29,7 +31,7 @@ To set up an IPC server, create an instance of `SmartIpc` with the type set to `
```typescript
const serverIpc = new SmartIpc({
type: 'server',
ipcSpace: 'myUniqueIpcSpace'
ipcSpace: 'myUniqueIpcSpace',
});
```
@@ -42,7 +44,7 @@ serverIpc.registerHandler({
keyword: 'greeting',
handlerFunc: (dataArg: string) => {
console.log(`Received greeting: ${dataArg}`);
}
},
});
```
@@ -62,7 +64,7 @@ Setting up a client is similar to setting up a server. Create a `SmartIpc` insta
```typescript
const clientIpc = new SmartIpc({
type: 'client',
ipcSpace: 'myUniqueIpcSpace'
ipcSpace: 'myUniqueIpcSpace',
});
```
@@ -118,7 +120,7 @@ serverIpc.registerHandler({
handlerFunc: (dataArg: string) => {
const dataObject = JSON.parse(dataArg);
console.log(dataObject.key); // Outputs: value
}
},
});
```
@@ -140,13 +142,13 @@ Always include error handling in production applications to manage unexpected sc
### Conclusion
Integrating `@push.rocks/smartipc` into your Node.js applications streamlines the process of setting up IPC for inter-process communication. Through the examples provided, you've seen how to configure both servers and clients, register message handlers, send messages, and incorporate error handling. With `smartipc`, you can facilitate robust communication channels between different parts of your application, enhancing modularity and process isolation.
Integrating `@push.rocks/smartipc` into your Node.js applications streamlines the process of setting up IPC for inter-process communication. Through the examples provided, you've seen how to configure both servers and clients, register message handlers, send messages, and incorporate error handling. With `smartipc`, you can facilitate robust communication channels between different parts of your application, enhancing modularity and process isolation.
For further information and advanced configuration options, refer to the `@push.rocks/smartipc` documentation.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.