therealwolf42 / nuxt-socket.io-module

Nuxt module for socket.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nuxt-socket.io-module

Nuxt wrapper around Vue-Socket.io-Extended, an implementation of socket.io into Vue.

npm version npm downloads Circle CI Codecov License

đź“– Release Notes

Setup

  1. Add nuxt-socket.io-module dependency to your project
yarn add nuxt-socket.io-module # or npm install nuxt-socket.io-module
  1. Add nuxt-socket.io-module to the modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxt-socket.io-module',

    // With options
    [
      'nuxt-socket.io-module',
      {
        autoConnect: false,
        url: 'http://localhost:9001',
        action: 'nuxtSocketReady'
      },
    ],
  ]
}
  1. Put your business logic into the vuex action: nuxtSocketReady (or choose a custom name), which is called as soon as the module is loaded.

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) therealwolf42

About

Nuxt module for socket.io

License:MIT License


Languages

Language:JavaScript 97.2%Language:Vue 2.8%