A JavaScript package for managing real-time collaboration sessions.
npm install real-time-collaboration-tool
const RealTimeCollaborationTool = require('realtime-tool');
// Create a new instance of the collaboration tool
const collaborationTool = new RealTimeCollaborationTool();
// Add users to the collaboration session
collaborationTool.addUser(1, 'User 1');
collaborationTool.addUser(2, 'User 2');
collaborationTool.addUser(3, 'User 3');
// Remove a user from the collaboration session
collaborationTool.removeUser(2);
// Get the list of all users in the collaboration session
const users = collaborationTool.getUsers();
console.log('Users in the session:', users);
Adds a new user to the collaboration session.
-
userId
: The unique identifier of the user. -
username
: The name of the user.
Removes a user from the collaboration session.
-
userId
: The unique identifier of the user to remove.
Returns an array containing the usernames of all users currently in the collaboration session.
This project is licensed under the MIT License - see the LICENSE file for details.