# chrome-dgram

> Use the Node `dgram` API in Chrome Apps

Latest version **3.0.6** (published 2020-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install chrome-dgram
pnpm add chrome-dgram
yarn add chrome-dgram
bun add chrome-dgram
```

## 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.6 |
| Published | 2020-10-27 |
| First published | 2013-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross, jscissr |
| Keywords | chrome app, chrome.socket, socket api, dgram, udp, wrapper, client, server |

## Links

- npm: https://www.npmjs.com/package/chrome-dgram
- Repository: https://github.com/feross/chrome-dgram
- Issues: https://github.com/feross/chrome-dgram/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/chrome-dgram

## Dependencies (2)

- [inherits](https://npm.io/package/inherits.md) ^2.0.4
- [run-series](https://npm.io/package/run-series.md) ^1.1.9

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.0.6 (latest) — 2020-10-27
- 3.0.5 — 2020-05-17
- 3.0.4 — 2019-10-06
- 3.0.3 — 2019-09-10
- 3.0.2 — 2019-06-28
- 3.0.1 — 2016-09-20
- 3.0.0 — 2016-07-27
- 2.1.7 — 2015-07-22
- 2.1.6 — 2015-07-21
- 2.1.5 — 2015-07-21
- 2.1.4 — 2015-07-02
- 2.1.3 — 2015-07-01
- 2.1.2 — 2015-05-04
- 2.1.1 — 2015-02-21
- 2.1.0 — 2015-01-23
- … 15 more at https://npm.io/package/chrome-dgram/versions

## README

# chrome-dgram [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/chrome-dgram/master.svg
[travis-url]: https://travis-ci.org/feross/chrome-dgram
[npm-image]: https://img.shields.io/npm/v/chrome-dgram.svg
[npm-url]: https://npmjs.org/package/chrome-dgram
[downloads-image]: https://img.shields.io/npm/dm/chrome-dgram.svg
[downloads-url]: https://npmjs.org/package/chrome-dgram
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Use the Node `dgram` API in Chrome Apps

This module lets you use the Node.js [dgram](http://nodejs.org/api/dgram.html) (UDP) API in [Chrome Packaged Apps](http://developer.chrome.com/apps/about_apps.html).

Instead of learning the quirks of Chrome's `chrome.sockets` API for networking in Chrome Apps just **use the higher-level node API you're familiar with**. Then, compile your code with [browserify](https://github.com/substack/node-browserify) and you're all set!

This module is used by [webtorrent](https://github.com/feross/webtorrent).

## install

```
npm install chrome-dgram
```

## methods

Use node's `dgram` API, including all parameter list shorthands and variations.

Example UDP client/bind:

```js
var dgram = require('chrome-dgram')

var sock = dgram.createSocket('udp4')

sock.send('beep', 0, 'beep'.length, 1337, '127.0.0.1')

sock.on('message', function (data, rInfo) {
  console.log('Got data from ' + rInfo.address + ':' + rInfo.port)
  console.log(data)
})
```

See nodejs.org for full API documentation: [dgram](http://nodejs.org/api/dgram.html)

## contribute

To run tests, use `npm test`. The tests will run TCP and UDP servers and launch a few different Chrome Packaged Apps with browserified client code. The tests currently require Chrome Canary on Mac. If you're on Windows or Linux, feel free to send a pull request to fix this limitation.

## license

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org) & John Hiesey.

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