socket.io-client
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

socket.io-client

[![Build Status](https://secure.travis-ci.org/socketio/socket.io-client.svg?branch=master)](http://travis-ci.org/socketio/socket.io-client) [![Dependency Status](https://david-dm.org/socketio/socket.io-client.svg)](https://david-dm.org/socketio/socket.io-

2.2.0  •  Published 1 years ago  •  by socketio  •  MIT License

socket.io-client

Build Status Dependency Status devDependency Status NPM version Downloads

Sauce Test Status

How to use

A standalone build of socket.io-client is exposed automatically by the socket.io server as /socket.io/socket.io.js. Alternatively you can serve the file socket.io.js found in the dist folder.

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io('http://localhost');
  socket.on('connect', function(){});
  socket.on('event', function(data){});
  socket.on('disconnect', function(){});
</script>
// with ES6 import
import io from 'socket.io-client';

const socket = io('http://localhost');

A slim build (without JSON3, a JSON polyfill for IE6/IE7, and debug) is also available: socket.io.slim.js.

Socket.IO is compatible with browserify and webpack (see example there).

Node.JS (server-side usage)

Add socket.io-client to your package.json and then:

var socket = require('socket.io-client')('http://localhost');
socket.on('connect', function(){});
socket.on('event', function(data){});
socket.on('disconnect', function(){});

API

See API

License

MIT

We are hiring frontend and backend developers!
Come and help us build the ultimate open source directory 🔥

Popularity

Weekly Downloads
3.0M
Stars
7.5K

Maintenance

Development

Last ver 1 year ago
Created 8 years ago
Last commit 1 year ago
3 days between commits

Technology

Node version: 10.13.0
1563.1K unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

107 contributors
Guillermo Rauch
Maintainer, 580 commits, 178 merges
Works at https://zeit.co
Damien Arrachequesne
Maintainer, 62 commits, 61 merges, 48 PRs
Arnout Kazemier
64 commits, 55 PRs
Works at godaddy
Leonid Khachaturov
55 commits
Naoyuki Kanezawa
Maintainer, 32 commits, 5 merges, 35 PRs
Works at zeit
whattokingu
28 commits, 3 PRs

Tags

realtime
framework
websocket
tcp
events
client
© 2019 Devstore, Inc.
Devstore helps developers find and use open-source packages, so they can focus on building amazing things