# metemq-thing-js

> MeteMQ Thing for JavaScript

Latest version **0.2.3** (published 2016-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install metemq-thing-js
pnpm add metemq-thing-js
yarn add metemq-thing-js
bun add metemq-thing-js
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2016-10-02 |
| First published | 2016-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | metemq |

## Links

- npm: https://www.npmjs.com/package/metemq-thing-js
- Repository: https://github.com/metemq/metemq-thing-js
- Homepage: https://github.com/metemq/metemq-thing-js#readme
- Issues: https://github.com/metemq/metemq-thing-js/issues
- npm.io page: https://npm.io/package/metemq-thing-js

## Dependencies (4)

- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [mqtt](https://npm.io/package/mqtt.md) ^1.12.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [mqtt-emitter](https://npm.io/package/mqtt-emitter.md) ^1.2.4

## Recent versions

- 0.2.3 (latest) — 2016-10-02
- 0.2.2 — 2016-10-01
- 0.2.1 — 2016-09-24
- 0.2.0 — 2016-09-24
- 0.1.2 — 2016-09-05
- 0.1.1 — 2016-09-05
- 0.1.0 — 2016-08-09
- 0.0.1 — 2016-08-07
- 0.0.0 — 2016-08-06

## README

# MeteMQ Thing JS
MeteMQ Thing library for Node.js

# Getting Started

Install MeteMQ Thing JS package

```bash
npm i --save metemq-thing-js
```

```js
var Thing = require('metemq-thing-js').Thing;
var thing = new Thing('MY_FIRST_METEMQ_THING_JS');

var sub = thing.subscribe('demo')

sub.on({
    added(name, age) {
        console.log(`${name}(${age})`);
    }
});

thing.call('hello', function(result) {
    console.log(`hello ${result}!`);
});

const temp = thing.bind('temp');

setInterval(function() {
    temp.set(Math.random());
}, 2000);

thing.actions({
  print(c, ...args){
    console.log(`message from server: ${args}`);
    c.done();
  }
})
```

# How to test?

```bash
npm test
```

Or, in order to watch

```bash
gulp watch
```

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