# wandering-willow-websocket

> A lightweight WebSocket wrapper for easy real-time communication in JavaScript.

Latest version **1.1.3** (published 2024-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install wandering-willow-websocket
pnpm add wandering-willow-websocket
yarn add wandering-willow-websocket
bun add wandering-willow-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 | 1.1.3 |
| Published | 2024-04-17 |
| First published | 2024-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | hilliermacarena |
| Keywords | websocket, real-time, communication, js |

## Links

- npm: https://www.npmjs.com/package/wandering-willow-websocket
- npm.io page: https://npm.io/package/wandering-willow-websocket

## Dependencies (5)

- [ws](https://npm.io/package/ws.md) ^7.4.6
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [debug](https://npm.io/package/debug.md) ^4.3.1
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^4.0.7
- [reconnect-core](https://npm.io/package/reconnect-core.md) ^1.3.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.3 (latest) — 2024-04-17
- 1.1.0 — 2024-03-16

## README

# Wandering Willow WebSocket

A lightweight wrapper around WebSockets for easy real-time communication in JavaScript, "wandering-willow-websocket" aims to simplify the process of establishing, managing, and closing WebSocket connections.

## Features

- Easy WebSocket connection management
- Automatic reconnection support
- Event-based interface for open, message, close, and error events
- Unique ID generation for clients

## Installation

```bash
npm install wandering-willow-websocket
```

## Usage

```javascript
const WanderingWillowWebSocket = require('wandering-willow-websocket');

const ws = new WanderingWillowWebSocket('ws://example.com');

ws.on('open', () => {
console.log('Connection opened');
ws.send('Hello, world!');
});

ws.on('message', (message) => {
console.log('Received:', message);
});

ws.on('close', () => {
console.log('Connection closed');
});

ws.on('error', (error) => {
console.error('Error:', error);
});
```

## API

- `send(data)`: Send data through the WebSocket connection.
- `close()`: Close the WebSocket connection.
- `static generateId()`: Generate a unique ID.

## License

MIT

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