# pubnub-dev

> Publish & Subscribe Real-time Messaging with PubNub

Latest version **3.7.10** (published 2015-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install pubnub-dev
pnpm add pubnub-dev
yarn add pubnub-dev
bun add pubnub-dev
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.7.10 |
| Published | 2015-05-07 |
| First published | 2015-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 562 |
| Author | PubNub |
| Maintainers | pubnub1 |
| Keywords | cloud, publish, subscribe, websockets, comet, bosh, xmpp, real-time, messaging |

## Links

- npm: https://www.npmjs.com/package/pubnub-dev
- Repository: https://github.com/pubnub/javascript
- Issues: https://github.com/pubnub/javascript/issues
- npm.io page: https://npm.io/package/pubnub-dev

## Dependencies (1)

- [agentkeepalive](https://npm.io/package/agentkeepalive.md) ~0.2

## 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.7.10 (latest) — 2015-05-07

## README

# PubNub Node.JS SDK and NPM 

PubNub for JS Docs have been moved to: http://www.pubnub.com/docs/javascript/javascript-sdk.html

## PubNub Node.js Quick Usage

Open `./tests/unit-test.js` to see examples for all the basics,
plus `history()`, `presence()` and `here_now()`! 
Report an issue, or email us at support if there are any
additional questions or comments.

#### NPM Install

```
npm install pubnub
```

#### Example Usage

```javascript
var pubnub = require("pubnub")({
    ssl           : true,  // <- enable TLS Tunneling over TCP
    publish_key   : "demo",
    subscribe_key : "demo"
});

/* ---------------------------------------------------------------------------
Publish Messages
--------------------------------------------------------------------------- */
var message = { "some" : "data" };
pubnub.publish({ 
    channel   : 'my_channel',
    message   : message,
    callback  : function(e) { console.log( "SUCCESS!", e ); },
    error     : function(e) { console.log( "FAILED! RETRY PUBLISH!", e ); }
});

/* ---------------------------------------------------------------------------
Listen for Messages
--------------------------------------------------------------------------- */
pubnub.subscribe({
    channel  : "my_channel",
    callback : function(message) {
        console.log( " > ", message );
    }
});

/* ---------------------------------------------------------------------------
Type Console Message
--------------------------------------------------------------------------- */
var stdin = process.openStdin();
stdin.on( 'data', function(chunk) {
    pubnub.publish({
        channel : "my_channel",
        message : ''+chunk
    });
});


```

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