# experimentation-mesg-js

> ## Services

Latest version **1.0.0-beta6** (published 2018-06-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install experimentation-mesg-js
pnpm add experimentation-mesg-js
yarn add experimentation-mesg-js
bun add experimentation-mesg-js
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta6 |
| Published | 2018-06-06 |
| First published | 2017-12-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Anthony Estebe |
| Maintainers | antho1404 |

## Links

- npm: https://www.npmjs.com/package/experimentation-mesg-js
- npm.io page: https://npm.io/package/experimentation-mesg-js

## Dependencies (2)

- [grpc](https://npm.io/package/grpc.md) ^1.12.2
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.12.0

## Recent versions

- 1.0.0-beta6 (latest) — 2018-06-06
- 1.0.0-beta5 — 2018-06-06
- 1.0.0-beta4 — 2018-06-06
- 1.0.0-beta3 — 2018-06-06
- 1.0.0-beta2 — 2017-12-20
- 1.0.0-beta1 — 2017-12-19
- 1.0.0 — 2017-12-19

## README

# MESG.js

## Services

Let's take this really simple service example
```yml
name: example
events:
  eventX:
    data: {}
tasks:
  start:
    inputs:
      isValid:
        type: Boolean
    outputs:
      valid:
        data: {}
      error:
        data: {}
```

#### Listen for tasks

```javascript
const MESG = require('mesg/service')

const start = ({ isValid }, { valid, error }) => isValid
  ? valid({})
  : error({})

MESG.listenTask({ start })
```

#### Emit event

```javascript
const MESG = require('mesg/service')

MESG.emitEvent("eventX", {
  foo: "bar"
}).then(...)
```

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