# jetstream-microservice

> Jetstream Node Package for easy implementation of Jetstream microservices

Latest version **0.1.8** (published 2018-08-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install jetstream-microservice
pnpm add jetstream-microservice
yarn add jetstream-microservice
bun add jetstream-microservice
```

## 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.1.8 |
| Published | 2018-08-14 |
| First published | 2017-03-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 277.5 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| Author | David Dyke |
| Maintainers | daviddykeuk, ddi.michal.piasecki |
| Keywords | Microservices, Jetstream, Kantar |

## Links

- npm: https://www.npmjs.com/package/jetstream-microservice
- npm.io page: https://npm.io/package/jetstream-microservice

## Dependencies (5)

- [guid](https://npm.io/package/guid.md) 0.0.12
- [amqplib](https://npm.io/package/amqplib.md) ^0.5.0
- [express](https://npm.io/package/express.md) ^4.14.0
- [request](https://npm.io/package/request.md) ^2.74.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^7.3.0

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.1.8 (latest) — 2018-08-14
- 0.1.3 (beta) — 2017-09-14
- 0.1.7 — 2018-07-18
- 0.1.6 — 2018-07-18
- 0.1.5 — 2018-01-12
- 0.1.4 — 2017-09-21
- 0.1.2 — 2017-06-22
- 0.1.1 — 2017-06-20
- 0.1.0 — 2017-06-16
- 0.0.16 — 2017-04-27
- 0.0.15 — 2017-04-27
- 0.0.14 — 2017-04-20
- 0.0.13 — 2017-04-07
- 0.0.12 — 2017-04-07
- 0.0.11 — 2017-04-07
- … 10 more at https://npm.io/package/jetstream-microservice/versions

## README

# Jetstream microservice

## New in v0.1.6
- Shorten key expiration to 5s
- Add tests for JWT signing

## New in v0.1.1
### Inter-service security added
Security now added to contact other services, use the Jetstream's version of request rather than request itself
```javascript
var jetstream = require('jetstream-microservice');
jetstream.request(options, next);
```

Remove inbound security
```javascript
process.env.IGNORE_JWT_SECURITY = "false";
```

# Getting started
Create a Jetstream service easily

You will need Jetstream core up and running to get this to work correctly.

First install express and jetstream-microservice
```bash
$ npm install --save express
$ npm install --save jetstream-microservice
```

Then create a simple *index.js* file...

```javascript
var express = require('express');

var app = express();

var jetstream = require('jetstream-microservice');

var port = 5099;

var options = {
    name: "test-service",
    location: "http://localhost:" + port
}

jetstream.init(app, options);

var server = app.listen(port);
```

And run...
```bash
$ node index.js
```

# Running tests

Default with summary only:
```
$ npm test
```

To see verbose test output, execute:
```
$ npm run test:detailed
```

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