socket.io-client
    Overview
    Insights & Analysis
    Code
    Versions
    Find an Expert
    Documentation
    Playground
    Issues
    Career Opportunities
    Alternatives
    Dependencies

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 9 months 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

Dependencies

Tags

realtime
framework
websocket
tcp
events
client
Avoid unsafe or low quality packages
Warn or block the installation of vulnerable, badly licensed, deprecated, outdated, unmaintained, or unpopular packages. Integrates with your npm and pre-commit/build scripts
Just $9/month per developer

Popularity

Weekly Downloads
3.0M
Stars
7.5K

Issues and PRs

Activity

Last ver 9 months ago
Created 8 years ago
Last commit 9 months ago
3 days between commits

Sustainability

107 contributors

Technology

Node version: 10.13.0
1563.1K unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Top Experts

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