# feathers-socketio

> The Feathers Socket.io real-time API provider

Latest version **2.0.1** (published 2017-10-31) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install feathers-socketio
pnpm add feathers-socketio
yarn add feathers-socketio
bun add feathers-socketio
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2017-10-31 |
| First published | 2016-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37 |
| Author | Feathers contributors |
| Maintainers | daffl, ekryski, marshallswain |
| Keywords | feathers, feathers-plugin |

## Links

- npm: https://www.npmjs.com/package/feathers-socketio
- Repository: https://github.com/feathersjs/feathers-socketio
- Issues: https://github.com/feathersjs/feathers-socketio/issues
- npm.io page: https://npm.io/package/feathers-socketio

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^3.0.0
- [socket.io](https://npm.io/package/socket.io.md) ^2.0.1
- [uberproto](https://npm.io/package/uberproto.md) ^1.2.0
- [@types/socket.io](https://npm.io/package/@types/socket.io.md) ~1.4.27
- [feathers-socket-commons](https://npm.io/package/feathers-socket-commons.md) ^2.0.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2017-10-31
- 3.0.0-pre.2 (pre) — 2017-10-18
- 3.0.0-pre.1 — 2017-10-17
- 2.0.0 — 2017-05-10
- 1.6.0 — 2017-04-18
- 1.5.2 — 2017-03-03
- 1.5.1 — 2017-03-02
- 1.5.0 — 2017-03-01
- 1.4.3 — 2017-02-24
- 1.4.2 — 2016-11-02
- 1.4.1 — 2016-05-23
- 1.4.0 — 2016-04-28
- 1.3.4 — 2016-04-16
- 1.3.3 — 2016-02-18
- 1.3.2 — 2016-02-11
- … 5 more at https://npm.io/package/feathers-socketio/versions

## README

# feathers-socketio

> _Important:_ For Feathers v3.0.0 or later use `@feathersjs/socketio` module instead of `feathers-socketio`.

[![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs/feathers-socketio.svg)](https://greenkeeper.io/)

[![Build Status](https://travis-ci.org/feathersjs/feathers-socketio.png?branch=master)](https://travis-ci.org/feathersjs/feathers-socketio)
[![Code Climate](https://codeclimate.com/github/feathersjs/feathers-socketio/badges/gpa.svg)](https://codeclimate.com/github/feathersjs/feathers-socketio)
[![Test Coverage](https://codeclimate.com/github/feathersjs/feathers-socketio/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/feathers-socketio/coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers-socketio.svg?style=flat-square)](https://david-dm.org/feathersjs/feathers-socketio)
[![Download Status](https://img.shields.io/npm/dm/feathers-socketio.svg?style=flat-square)](https://www.npmjs.com/package/feathers-socketio)
[![Slack Status](http://slack.feathersjs.com/badge.svg)](http://slack.feathersjs.com)

> The Feathers Socket.io real-time API provider

## About

This provider exposes [Feathers](http://feathersjs.com) services through a [Socket.io](http://socket.io/) real-time API. It is compatible with Feathers 1.x and 2.x.

__Note:__ For the full API documentation go to [https://docs.feathersjs.com/api/socketio.html](https://docs.feathersjs.com/api/socketio.html).

## Quick example

```js
import feathers from 'feathers';
import socketio from 'feathers-socketio';

const app = feathers()
  .configure(socketio(function(io) {
    io.on('connection', function(socket) {
      socket.emit('news', { hello: 'world' });
      socket.on('my other event', function (data) {
        console.log(data);
      });
    });

    io.use(function(socket, next) {
      socket.feathers.data = 'Hello world';
      next();
    });

    io.use(function (socket, next) {
      // Authorize using the /users service
      app.service('users').find({
        username: socket.request.username,
        password: socket.request.password
      }, next);
    });
  }));

app.use('/todos', {
  get: function(id, params) {
    console.log(params.data); // -> 'Hello world'

    return Promise.resolve({
      id,
      description: `You have to do ${name}!`
    });
  }
});
```

## Client use

```js
import io from 'socket.io-client';
import feathers from 'feathers/client';
import socketio from 'feathers-socketio/client';

const socket = io('http://path/to/api');
const app = feathers()
  .configure(socketio(socket));
```

## License

Copyright (c) 2015

Licensed under the [MIT license](LICENSE).

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