Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sockettwo

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sockettwo - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

Services/socketConnect.js

21

index.js
const io = require("socket.io-client");
// const SConnect = require("./Services/socketConnect");
// Function to connect the socket
function connectSocket(url) {

@@ -17,2 +19,3 @@ const socket = io(url);

// function to disconnect the socket
function disconnectSocket(url) {

@@ -30,5 +33,23 @@ const socket = io(url);

// Function to emit the message from client
// Taking the event name and data from client to emit socket
async function emitContent(emitBody) {
try {
const status = await socket.emit("track", emitBody, (response) => {
return "Emitted!";
});
if (status) {
return status;
}
} catch (error) {
return error;
}
}
module.exports = {
socketConnect: connectSocket,
socketDisconnect: disconnectSocket,
socketEmit: emitContent,
};

2

package.json

@@ -6,3 +6,3 @@ {

"name": "sockettwo",
"version": "1.1.1",
"version": "1.1.2",
"main": "index.js",

@@ -9,0 +9,0 @@ "devDependencies": {},

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc