# messenger-ws

> Simple messenger abstraction that sends and receives messages via a WebSocket connection

Latest version **3.0.1** (published 2016-01-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install messenger-ws
pnpm add messenger-ws
yarn add messenger-ws
bun add messenger-ws
```

## 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 | 3.0.1 |
| Published | 2016-01-04 |
| First published | 2014-10-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Damon Oehlman |
| Maintainers | damonoehlman |
| Keywords | messenger, websocket |

## Links

- npm: https://www.npmjs.com/package/messenger-ws
- Repository: https://github.com/DamonOehlman/messenger-ws
- Issues: https://github.com/DamonOehlman/messenger-ws/issues
- npm.io page: https://npm.io/package/messenger-ws

## Dependencies (4)

- [ws](https://npm.io/package/ws.md) ^1.0.0
- [cog](https://npm.io/package/cog.md) ^1.0.0
- [wsurl](https://npm.io/package/wsurl.md) ^1.0.0
- [pull-ws](https://npm.io/package/pull-ws.md) ^2.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2016-01-04
- 2.0.2 — 2015-04-28
- 2.0.0 — 2015-03-24
- 1.2.5 — 2015-03-09
- 1.2.4 — 2015-03-01
- 1.2.3 — 2015-03-01
- 1.2.2 — 2014-12-18
- 1.2.1 — 2014-12-18
- 1.2.0 — 2014-11-12
- 1.1.0 — 2014-10-27
- 1.0.0 — 2014-10-24

## README

# messenger-ws

This is a simple messaging implementation for sending and receiving data
via websockets.

Follows the [messenger-archetype](https://github.com/DamonOehlman/messenger-archetype)


[![NPM](https://nodei.co/npm/messenger-ws.png)](https://nodei.co/npm/messenger-ws/)

[![unstable](https://img.shields.io/badge/stability-unstable-yellowgreen.svg)](https://github.com/dominictarr/stability#unstable) [![Build Status](https://img.shields.io/travis/DamonOehlman/messenger-ws.svg?branch=master)](https://travis-ci.org/DamonOehlman/messenger-ws) [![bitHound Score](https://www.bithound.io/github/DamonOehlman/messenger-ws/badges/score.svg)](https://www.bithound.io/github/DamonOehlman/messenger-ws)

## `bufferutil` and `utf-8-validate`

With the release of [`ws@1.0.0`](https://github.com/websockets/ws), both `bufferutil` and `utf-8-validate` are no longer included as dependencies. This is primilarly due to the fact that these are both binary addons, and cause issues when a C++ compiler is not installed or not found, or when a C++11 compliant compiler is not installed (for >= Node 4.0.0 to be compliant, use >= gcc 4.8 or >= clang 3.5).

These optional dependencies extend through to `messenger-ws`. The tests are run using `bufferutil` and `utf-8-validate`, however, these are optional dependencies and will not be installed with `messenger-ws` by default. However, it is highly recommended that you do install these dependencies, as they provide significant benefits.

## Example Usage

```js
var pull = require('pull-stream');
var queue = require('pull-pushable')();
var messenger = require('messenger-ws')('ws://localhost:3000/echo');

messenger(function(err, source, sink) {
  if (err) {
    return console.error(err);
  }

  // log data coming from the socket
  pull(source, pull.log());

  // wire the queue to sink
  pull(queue, sink);
});

setInterval(function() {
  queue.push('current time: ' + Date.now());
}, 150);

```

## License(s)

### ISC

Copyright (c) 2015, Damon Oehlman <damon.oehlman@gmail.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

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