# harbourmaster-client

> Harbourmaster Client

Latest version **0.1.0** (published 2014-04-13) · 0 weekly downloads

## Install

```sh
npm install harbourmaster-client
pnpm add harbourmaster-client
yarn add harbourmaster-client
bun add harbourmaster-client
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-04-13 |
| First published | 2014-04-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0.10.x |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wayne Leroux |
| Maintainers | harbour |

## Links

- npm: https://www.npmjs.com/package/harbourmaster-client
- Repository: https://github.com/harbour-io/harbourmaster-client
- Issues: https://github.com/harbour-io/harbourmaster-client/issues
- npm.io page: https://npm.io/package/harbourmaster-client

## Recent versions

- 0.1.0 (latest) — 2014-04-13

## README

# Harbourmaster Client

The client for Harbourmaster simplifies communication to the harbourmaster client.

By simplifying service discovery, a network of microservices can communicate to one-another without hard-coded configuration.

## Service Implementation

```
var argv = require('minimist')(process.argv.splice(2)),
    hm_host = argv.host || "localhost",
    hm_port = argv.port || 8080;
var hm = require('harbourmaster-client')(hm_host, hm_port),
    net = require('net');

var server = net.createServer(function(socket) {
  console.log("Connection Established.");
  socket.on('data', function(data) {
    console.log("Received:", data.toString());
    socket.write("You wrote: "+ data.toString());
  });
}).listen(function() {
  console.log("Listening on: "+ this.address().port);
  hm.register('echo', this.address(), function(err) {
    if (err) throw err;
  });
});
```

## Service Client Implementation

```
var argv = require('minimist')(process.argv.splice(2)),
    hm_host = argv.host || "localhost",
    hm_port = argv.port || 8080;
var hm = require('harbourmaster-client')(hm_host, hm_port),
    Socket = require('net').Socket;

hm.get('echo', function(err, address) {
    if (err) throw err;

    var socket = new Socket();
    socket.connect(address.port, address.address);
    socket.write("Hello World");
    socket.on("data", function(data) {
        console.log("Response: " + data.toString());
        socket.end();
    });
});
```

---
_Source: https://npm.io/package/harbourmaster-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
