Skip to content

Commit

Permalink
Updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbordet authored Jul 4, 2017
1 parent c123851 commit 55bc621
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
## The CometD Project

### CometD client for NodeJS
### CometD NodeJS Client

Adapter code that allows the [CometD client JavaScript library](https://github.com/cometd/cometd-javascript) to run in a NodeJS environment.
This project implements adapter code that allows the [CometD JavaScript Client](https://github.com/cometd/cometd-javascript) to run in a NodeJS environment.

The adapter code exports an implementation of `XMLHttpRequest` so that the CometD JavaScript Client works in NodeJS as it does within a browser environment.

WebSocket is not (yet) supported.

### NPM Installation

Firstly, you need to install the CometD NodeJS Client:

```
npm install cometd-nodejs-client
```

The CometD NodeJS Client does not depend on the CometD JavaScript Client; you need the CometD JavaScript Client to develop your applications.

Therefore, you need to install the CometD JavaScript Client, version 3.1.2 or greater:

```
npm install cometd
```

### Usage

```javascript
// Run the adapter code.
// Run the adapter code that implements XMLHttpRequest.
require('cometd-nodejs-client').adapt();

// Your normal CometD client application here.
var lib = require('cometd');
var cometd = new lib.CometD();
...
```

See [here](https://github.com/cometd/cometd-javascript/blob/master/README.md) for an example CometD client application.

0 comments on commit 55bc621

Please sign in to comment.