# datagram-stream

> Streaming UDP with broadcast, multicast and unicast options

Latest version **1.1.1** (published 2017-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install datagram-stream
pnpm add datagram-stream
yarn add datagram-stream
bun add datagram-stream
```

## 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.1.1 |
| Published | 2017-06-11 |
| First published | 2014-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Dan VerWeire |
| Maintainers | wankdanker |
| Keywords | udp, dgram, datagram, stream |

## Links

- npm: https://www.npmjs.com/package/datagram-stream
- Repository: https://github.com/wankdanker/node-datagram-stream
- Issues: https://github.com/wankdanker/node-datagram-stream/issues
- npm.io page: https://npm.io/package/datagram-stream

## 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

- 1.1.1 (latest) — 2017-06-11
- 1.1.0 — 2016-03-13
- 1.0.8 — 2015-04-07
- 1.0.7 — 2015-02-27
- 1.0.5 — 2014-10-02
- 1.0.4 — 2014-10-02
- 1.0.3 — 2014-10-02
- 1.0.2 — 2014-09-26
- 1.0.1 — 2014-09-26

## README

datagram-stream
---------------

[![Build Status](https://travis-ci.org/wankdanker/node-datagram-stream.svg)](https://travis-ci.org/wankdanker/node-datagram-stream)

A streaming UDP module with broadcast, multicast and unicast options.

install
-------

```bash
npm install datagram-stream
```

usage
-----

## multicast

```js
var udp = require('datagram-stream');

var stream = udp({
    address     : '0.0.0.0'   //address to bind to
    , multicast : '239.5.5.5' //multicast ip address to send to and listen on
    , port      : 5555        //udp port to send to
    , bindingPort : 5556      //udp port to listen on. Default: port
    , reuseAddr : true        //boolean: allow multiple processes to bind to the
                              //         same address and port. Default: true
    , loopback  : true        //boolean: whether or not to receive sent datagrams
                              //         on the loopback device. Only applies to
                              //         multicast. Default: false
});

//pipe whatever is received to stdout
stream.pipe(process.stdout);

//pipe whatever is received on stdin over udp
process.stdin.pipe(stream);
```

## broadcast

```js
var udp = require('datagram-stream');

var stream = udp({
    address     : '0.0.0.0'         //address to bind to
    , broadcast : '255.255.255.255' //broadcast ip address to send to
    , port      : 5555              //udp port to send to
    , bindingPort : 5556            //udp port to listen on. Default: port
    , reuseAddr : true              //boolean: allow multiple processes to bind to the
                                    //         same address and port. Default: true
 });

//pipe whatever is received to stdout
stream.pipe(process.stdout);

//pipe whatever is received on stdin over udp
process.stdin.pipe(stream);
```

## unicast

```js
var udp = require('datagram-stream');

var stream = udp({
    address     : '0.0.0.0'   //address to bind to
    , unicast   : '127.0.0.1' //unicast ip address to send to
    , port      : 5555        //udp port to send to
    , bindingPort : 5556      //udp port to listen on. Default: port
    , reuseAddr : true        //boolean: allow multiple processes to bind to the
                              //         same address and port. Default: true
 });

//pipe whatever is received to stdout
stream.pipe(process.stdout);

//pipe whatever is received on stdin over udp
process.stdin.pipe(stream);
```

acknowledgments
---------------

I used @dominictarr's [broadcast-stream](https://github.com/dominictarr/broadcast-stream) as a
guide for how to implement the stream.


license
-------

MIT

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