Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap32 committed Nov 27, 2017
1 parent 176a60a commit 9d3e05b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ A promise based WebSocket implementation for Node.js. Built on top of [ws](https
- [Installation](#installation)
- [API Reference](#api-reference)
- [Server.create\(options\)](#servercreateoptions)
- [Server Events](#server-events)
- [server#onReply\(name, response\)](#serveronreplyname-response)
- [server#addReply\(name, response\)](#serveraddreplyname-response)
- [server#reply\(name, response\)](#serverreplyname-response)
Expand All @@ -27,6 +28,7 @@ A promise based WebSocket implementation for Node.js. Built on top of [ws](https
- [Client.create\(address\[, options\]\)](#clientcreateaddress-options)
- [Client.connect\(address, waitUntil\)](#clientconnectaddress-waituntil)
- [Client.autoReconnect\(address, waitUntil\[, delay\]\)](#clientautoreconnectaddress-waituntil-delay)
- [Client Events](#client-events)
- [client#onReply\(name, response\)](#clientonreplyname-response)
- [client#addReply\(name, response\)](#clientaddreplyname-response)
- [client#reply\(name, response\)](#clientreplyname-response)
Expand Down Expand Up @@ -88,6 +90,16 @@ $ npm install promise-ws
Create a WebSocket server


<a name="server-events"></a>
### Server Events

Server extends [EventEmitter](https://nodejs.org/api/events.html), which forwards these events from [WebSocket.Server](https://github.com/websockets/ws/blob/master/doc/ws.md#class-websocketserver):

- [connection](https://github.com/websockets/ws/blob/master/doc/ws.md#event-connection)
- [error](https://github.com/websockets/ws/blob/master/doc/ws.md#event-error)
- [headers](https://github.com/websockets/ws/blob/master/doc/ws.md#event-headers)


<a name="serveronreplyname-response"></a>
### server#onReply(name, response)

Expand Down Expand Up @@ -273,6 +285,20 @@ import { Client } from 'promise-ws';
}());
```

<a name="client-events"></a>
### Client Events

Client extends [EventEmitter](https://nodejs.org/api/events.html), which forwards these events from [WebSocket.Client](https://github.com/websockets/ws/blob/master/doc/ws.md#class-websocket):

- [close](https://github.com/websockets/ws/blob/master/doc/ws.md#event-close)
- [error](https://github.com/websockets/ws/blob/master/doc/ws.md#event-error-1)
- [headers](https://github.com/websockets/ws/blob/master/doc/ws.md#event-headers-1)
- [message](https://github.com/websockets/ws/blob/master/doc/ws.md#event-message)
- [open](https://github.com/websockets/ws/blob/master/doc/ws.md#event-open)
- [ping](https://github.com/websockets/ws/blob/master/doc/ws.md#event-ping)
- [pong](https://github.com/websockets/ws/blob/master/doc/ws.md#event-pong)
- [unexpected-response](https://github.com/websockets/ws/blob/master/doc/ws.md#event-unexpected-response)


<a name="clientonreplyname-response"></a>
### client#onReply(name, response)
Expand Down

0 comments on commit 9d3e05b

Please sign in to comment.