# @mr-mahawar/lib-ws-web

> Web Socket library with TypeScript support!

Latest version **1.0.5** (published 2022-11-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mr-mahawar/lib-ws-web
pnpm add @mr-mahawar/lib-ws-web
yarn add @mr-mahawar/lib-ws-web
bun add @mr-mahawar/lib-ws-web
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-11-02 |
| First published | 2022-10-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mr-mahawar |
| Maintainers | mr-mahawar |

## Links

- npm: https://www.npmjs.com/package/@mr-mahawar/lib-ws-web
- Repository: https://github.com/learnapp-co/lib-ws-web
- Homepage: https://github.com/learnapp-co/lib-ws-web#readme
- Issues: https://github.com/learnapp-co/lib-ws-web/issues
- npm.io page: https://npm.io/package/@mr-mahawar/lib-ws-web

## Dependencies (1)

- [@sohailalam2/abu](https://npm.io/package/@sohailalam2/abu.md) ^0.2.0

## Recent versions

- 1.0.5 (latest) — 2022-11-02
- 1.0.4 — 2022-11-02
- 1.0.3 — 2022-11-02
- 1.0.2 — 2022-10-29
- 1.0.1 — 2022-10-28
- 1.0.0 — 2022-10-28

## README

# Web Socket Library for Web
Simple wrapper to maintain Web Socket connection made in TypeScript.
*In development ⚙️*

## Install
    npm i @mr-mahawar/lib-ws-web

## Usage
    import  { createWebScoket }  from  '@mr-mahawar/lib-ws-web';

    const  done  =  createWebScoket(
	    WS_URL,
	    {
		    onOpen: yourOnOpenListener,
		    onMessage: yourOnMessageListener,
		    onClose: yourOnCloseListener,
		    onError: yourOnErrorListener
	    }
    );

In your listeners you will receive the web-socket event directly. These are all optional.

For sending any message or closing the web-socket connection we have these functions that we can import:
    import  { sendMessage,  closeConnection }  from  '@mr-mahawar/lib-ws-web';
    
    sendMessage('Your message!'); //Accepts string  |  ArrayBufferLike  |  Blob  |  ArrayBufferView 
    closeConnection(); //This will close the connection

## More features to come...

---
_Source: https://npm.io/package/@mr-mahawar/lib-ws-web · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
