# bograch

> A communication gateway for NodeJS microservices.

Latest version **0.0.18** (published 2015-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install bograch
pnpm add bograch
yarn add bograch
bun add bograch
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.18 |
| Published | 2015-04-04 |
| First published | 2015-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zoltan Kochan |
| Maintainers | zkochan |
| Keywords | bograch, microservice, node, communication |

## Links

- npm: https://www.npmjs.com/package/bograch
- Repository: https://github.com/zkochan/bograch
- Issues: https://github.com/zkochan/bograch/issues
- npm.io page: https://npm.io/package/bograch

## Dependencies (1)

- [debug](https://npm.io/package/debug.md) ^2.1.3

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.0.18 (latest) — 2015-04-04
- 0.0.17 — 2015-04-04
- 0.0.16 — 2015-04-04
- 0.0.15 — 2015-04-04
- 0.0.14 — 2015-04-04
- 0.0.13 — 2015-03-31
- 0.0.12 — 2015-03-31
- 0.0.11 — 2015-03-30
- 0.0.10 — 2015-03-24
- 0.0.9 — 2015-03-24
- 0.0.8 — 2015-03-19
- 0.0.7 — 2015-03-18
- 0.0.6 — 2015-03-18
- 0.0.5 — 2015-03-18
- 0.0.4 — 2015-03-17
- … 3 more at https://npm.io/package/bograch/versions

## README

# Bograch

[![Dependency Status](https://david-dm.org/zkochan/bograch/status.svg?style=flat)](https://david-dm.org/zkochan/bograch)
[![Build Status](http://img.shields.io/travis/zkochan/bograch.svg?style=flat)](https://travis-ci.org/zkochan/bograch)


Bograch is a tool for abstracting RPC (remote procedure call) communication between/with NodeJS microservices.

Usage
======
Add a transporter.
``` js
var bo = require('bograch');
var AmqpTransporter = require('bograch-amqp');

bo.use(new AmqpTransporter({
  amqpURL: 'amqp://guest:guest@localhost:5672'
}));
```
Create a microservice for mathematical calculations and implement some remote methods.
``` js
var server = bo.server('amqp', {
  name: 'mathOperations'
});

server.on('sum', function (a, b, cb) {
  cb(null, a + b);
});

server.on('factorial', function (n, cb) {
  var f = 1;
  for (var i = 2; i <= n; i++) {
    f *= i;
  }
  cb(null, f);
});
```
Create a client for the math microservice and call some of its remote methods.
``` js
var client = bo.client('amqp', {
  name: 'mathOperations'
});
client.register(['sum', 'factorial']);

var Math = client.methods;

Math.sum(12, 2, function (err, sum) {
  console.log(sum);
});

Math.factorial(10, function (err, result) {
  console.log(result);
});
```

License
========

The MIT License (MIT)

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