# anteton-chat-client

> client

Latest version **1.2.6** (published 2024-02-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install anteton-chat-client
pnpm add anteton-chat-client
yarn add anteton-chat-client
bun add anteton-chat-client
```

## 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.2.6 |
| Published | 2024-02-15 |
| First published | 2023-11-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Anteton |
| Maintainers | anteton |

## Links

- npm: https://www.npmjs.com/package/anteton-chat-client
- npm.io page: https://npm.io/package/anteton-chat-client

## Dependencies (1)

- [ws](https://npm.io/package/ws.md) ^8.16.0

## Recent versions

- 1.2.6 (latest) — 2024-02-15
- 1.2.5 — 2024-02-11
- 1.2.4 — 2024-02-11
- 1.2.3 — 2024-02-04
- 1.2.2 — 2024-02-03
- 1.2.1 — 2024-01-29
- 1.2.0 — 2024-01-18
- 1.1.9 — 2024-01-15
- 1.1.8 — 2024-01-15
- 1.1.7 — 2024-01-15
- 1.1.6 — 2023-12-16
- 1.1.5 — 2023-12-16
- 1.1.4 — 2023-12-13
- 1.1.3 — 2023-12-08
- 1.1.2 — 2023-12-05
- … 11 more at https://npm.io/package/anteton-chat-client/versions

## README

example:
```js
const Client = require('anteton-chat-client');

const client = new Client({url: 'url to the WS server', username: 'username', auth: 'authorization stuff'});

client.onopen(() => {
  client.say('hello!');
  client.onmessage((msg) => {
    if (msg.username !== 'bot') {
      client.say(`${msg.username}: ${msg.message}`);
    }
    if (msg.message == '/close' && msg.username !== 'bot') {
      client.close();
    }
  });
  client.onclose(() => {
    console.log('disconnected!');
  });
  client.onuserjoin((username) => {
    client.say(`'hello @${username}'`);
  });
  client.onuserleave((username) => {
    client.say(`bye @${username}`);
  });
});
```

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