# weex.adapter.websocket

> A W3C-compliant webSocket object based on the weex webSocket module

Latest version **2.0.1** (published 2019-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install weex.adapter.websocket
pnpm add weex.adapter.websocket
yarn add weex.adapter.websocket
bun add weex.adapter.websocket
```

## 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 | 2.0.1 |
| Published | 2019-06-13 |
| First published | 2019-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | 236241416@qq.com |
| Maintainers | lincwong |
| Keywords | weex, websocket, socket.io-client, engine.io-client, socket.io |

## Links

- npm: https://www.npmjs.com/package/weex.adapter.websocket
- Repository: https://github.com/LincWong/weex.adapter.websocket
- Homepage: https://github.com/LincWong/weex.adapter.websocket#readme
- Issues: https://github.com/LincWong/weex.adapter.websocket/issues
- npm.io page: https://npm.io/package/weex.adapter.websocket

## Dependencies (1)

- [event-target](https://npm.io/package/event-target.md) ^1.2.3

## Recent versions

- 2.0.1 (latest) — 2019-06-13
- 1.0.2 — 2019-05-14
- 1.0.1 — 2019-05-13
- 1.0.0 — 2019-05-13

## README

# weex.adapter.websocket
A W3C-compliant webSocket object based on the weex webSocket module

# Installation

```js
yarn add weex.adapter.websocket
```

or

```js
npm install weex.adapter.websocket
```

# How to use

```js
var Websocket = require('weex.adapter.websocket')
var ws = new WebSocket('wss://<doman>:<port>')
ws.onopen = function(){}
ws.addEventListener('open',function(){})
ws.onmessage = function(e){}
ws.onclose = function(){}
ws.send('hello word')
```

# When is it used?

- Develop websocket application in weex with W3C standard syntax
- Make existing libraries compatible with weex by replacing them. Such as socket.io-client

# Some products

- [engine.io-client-weex](https://www.npmjs.com/package/engine.io-client-weex)
- [socket.io-client-weex](https://www.npmjs.com/package/socket.io-client-weex)

# Reference materials
- https://github.com/stackOverMind/WeApp-adapter
- https://developer.mozilla.org/zh-CN/docs/Web/API/WebSocket
- https://developer.mozilla.org/en-US/docs/Web/API/EventTarget

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