New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

socketio-chat-core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socketio-chat-core

Lightweight Socket.IO chat server/client wrappers.

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

socketio-chat-core

Lightweight Socket.IO chat wrappers for server and client.

Install

npm install socketio-chat-core

Usage

Server (Node.js)

const { createChatServer } = require('socketio-chat-core');

const server = createChatServer({ port: 4000, corsOrigin: '*' });
server.start();

Client (browser/Node)

const { createChatClient } = require('socketio-chat-core');

const client = createChatClient({ url: 'http://localhost:4000' });
client.connect();
client.joinRoom('room-1');
client.onMessage((m) => console.log('message:', m));
client.sendMessage('room-1', 'user-1', 'hello');

API

  • createChatServer(options)
    • port (default: 3000)
    • corsOrigin (default: *)
    • path (default: /socket.io)
  • createChatClient(options)
    • url (required)
    • path (default: /socket.io)
    • transports (default: ['websocket'])
    • autoConnect (default: true)

Events:

  • room:join, room:leave
  • chat:send to emit a message
  • chat:message to receive a message
  • chat:typing typing indicator

Develop

  • Start example server: npm run dev:server
  • Start example client: npm run dev:client

Publish

  • Update the package name to a unique value in package.json
  • Build: npm run build
  • Publish: npm publish --access public

MIT License

Keywords

socket.io

FAQs

Package last updated on 13 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts