# socket.io-vuewrapper

> [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url]

Latest version **1.1.0** (published 2022-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install socket.io-vuewrapper
pnpm add socket.io-vuewrapper
yarn add socket.io-vuewrapper
bun add socket.io-vuewrapper
```

## 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.0 |
| Published | 2022-06-09 |
| First published | 2022-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nick-I-A |
| Maintainers | nick-i-a |

## Links

- npm: https://www.npmjs.com/package/socket.io-vuewrapper
- Repository: https://github.com/Nick-I-A/socket.io-vuewrapper
- Homepage: https://github.com/Nick-I-A/socket.io-vuewrapper#readme
- Issues: https://github.com/Nick-I-A/socket.io-vuewrapper/issues
- npm.io page: https://npm.io/package/socket.io-vuewrapper

## Dependencies (1)

- [socket.io-client](https://npm.io/package/socket.io-client.md) ^4.5.1

## Recent versions

- 1.1.0 (latest) — 2022-06-09
- 1.0.1 — 2022-06-09
- 1.0.0 — 2022-06-09

## README

# socket.io-vuewrapper
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]

Other versions support outdated dependencies, no longer receive updates or do not respond to pull requests, which is why socket.io-vuewrapper was created.

Parts of this [REPO](https://github.com/kil0ba/Vue-3-Socket.io) were used, so thanks to David Gurshumov and Metin Seylan.

### 🚀 Installation
`npm i socket.io-vuewrapper --save`

## Example
src/main.js
```Javascript
import { createApp } from 'vue';
import App from './App.vue';
import VueSocketIO from 'socket.io-vuewrapper';

const vSocket = new VueSocketIO({
    debug: true,
    connection: 'http://localhost:8000'
});

createApp(App).use(vSocket).mount('#app')
```

**Parameters**|**Type's**|**Default**|**Required**|**Description**
-----|-----|-----|-----|-----
debug|Boolean|`false`|Optional|Enable logging for debug
connection|String/Socket.io-client|`null`|Required|Websocket server url or socket.io-client instance

src/App.vue
```Vue
...
<script>
export default {
  mounted() {
    // Check if you are connected to the server
    if (this.$socket.connected) {
      // Send an object to the connected server
      this.$socket.emit('test', { message: "example" });
    }
  },
  sockets: {
    // Listen for the custom `test` event
    test: function(msg) {
      console.log(msg);
    }
  }
}
</script>
...
```

[contributors-shield]: https://img.shields.io/github/contributors/Nick-I-A/socket.io-vuewrapper.svg?style=for-the-badge
[contributors-url]: https://github.com/Nick-I-A/socket.io-vuewrapper/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Nick-I-A/socket.io-vuewrapper.svg?style=for-the-badge
[forks-url]: https://github.com/Nick-I-A/socket.io-vuewrapper/network/members
[stars-shield]: https://img.shields.io/github/stars/Nick-I-A/socket.io-vuewrapper.svg?style=for-the-badge
[stars-url]: https://github.com/Nick-I-A/socket.io-vuewrapper/stargazers
[issues-shield]: https://img.shields.io/github/issues/Nick-I-A/socket.io-vuewrapper.svg?style=for-the-badge
[issues-url]: https://github.com/Nick-I-A/socket.io-vuewrapper/issues

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