# socketio-wildcard

> socket.io with a wildcard event

Latest version **2.0.0** (published 2017-05-22) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 38/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-05-22 |
| First published | 2014-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/socketio-wildcard) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 198 |
| Author | Hao-kang Den |
| Maintainers | hden |
| Keywords | socket.io, websocket |

## Links

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

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-05-22
- 0.4.0 — 2017-03-15
- 0.3.0 — 2015-12-21
- 0.2.0 — 2015-11-29
- 0.1.1 — 2014-05-31
- 0.1.0 — 2014-05-30

## README

socketio-wildcard
=================

[![Build Status](https://img.shields.io/travis/hden/socketio-wildcard.svg)](https://travis-ci.org/hden/socketio-wildcard)
[![Dependencies](https://img.shields.io/david/hden/socketio-wildcard.svg)](https://david-dm.org/hden/socketio-wildcard)
[![devDependencies](https://img.shields.io/david/dev/hden/socketio-wildcard.svg)](https://david-dm.org/hden/socketio-wildcard#info=devDependencies)
[![npm](https://img.shields.io/npm/dm/socketio-wildcard.svg)](https://www.npmjs.com/package/socketio-wildcard)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

[![npm](https://nodei.co/npm-dl/socketio-wildcard.png?height=3)](https://nodei.co/npm/socketio-wildcard/)

Socket.io with a wildcard event.

Works with Socket.io `v1.x` - `v2.x`.

Tested with node.js `v4.x`, `v5.x`, `v6.x`, `v7.x`.

Installation
------------

    npm install --save socketio-wildcard


Usage
-----

### Server

```js
var io         = require('socket.io')();
var middleware = require('socketio-wildcard')();

io.use(middleware);

io.on('connection', function(socket) {
  socket.on('*', function(packet){
    // client.emit('foo', 'bar', 'baz')
    packet.data === ['foo', 'bar', 'baz']
  });
});

io.listen(8000);
```

### Client

```js
var io = require('socket.io-client');
var socket = io('http://localhost');
// piggyback using the event-emitter bundled with socket.io client
var patch = require('socketio-wildcard')(io.Manager);
patch(socket);

socket.on('*', function(){ /* … */ })
```

Changelog
---------

### [2.0.0] - 2016-05-23
- no breaking change
- update test dependencies for socket.io v2

### [0.3.0] - 2015-12-21
- allow custom event emitter
- support socket.io client

### [0.2.0] - 2015-11-29
- wildcard listener for all events get called first ([@Michael77](https://github.com/Michael77))
- removed coffee-script dependency

Licence
-------
MIT

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