## Usage
“`js
const { createServer } = require(‘@dnode/server’);
const { createClient } = require(‘@dnode/client’);
// Create a server instance.
const server = createServer();
// Start the server.
server.listen(3000);
// Register a service.
server.register(‘echo’, (data, callback) => { // The service name is ‘echo’.
callback(null, data); // Echo back the data to the client.
});
// Create a client instance and connect to the server.
const client = createClient();
// Call the ‘echo’ service on the server with some data.
client.call(‘echo’, ‘Hello World!’, (err, result) => {
if (err) {
console.error(err);
} else {
console.log(result); // Prints ‘Hello World!’
}
});
// Close the connection when done.
client.close();