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

@crypticat/core

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crypticat/core - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

4

lib/server.d.ts
/// <reference types="node" />
import WebSocket from 'ws';
import { EventEmitter } from 'events';
import { Server as HttpServer } from 'http';
import { Server as HttpsServer } from 'https';
export interface Room {

@@ -22,4 +24,4 @@ name: string;

constructor();
listen(port: number): void;
listen(location: HttpServer | HttpsServer | number, path?: string): void;
}
export { CrypticatServer };

@@ -20,2 +20,4 @@ "use strict";

const events_1 = require("events");
const http_1 = require("http");
const https_1 = require("https");
class CrypticatServer extends events_1.EventEmitter {

@@ -27,4 +29,15 @@ constructor() {

}
listen(port) {
this.wss = new ws_1.default.Server({ port });
listen(location, path) {
if (location instanceof http_1.Server || location instanceof https_1.Server) {
this.wss = new ws_1.default.Server({
server: location,
path
});
}
else if (typeof location === 'number') {
this.wss = new ws_1.default.Server({
port: location,
path
});
}
this.wss.on('connection', (ws) => __awaiter(this, void 0, void 0, function* () {

@@ -31,0 +44,0 @@ const uid = yield uid_promise_1.default(20);

{
"name": "@crypticat/core",
"version": "0.1.4",
"version": "0.1.5",
"description": "Crypticat's core client and server implementation",

@@ -21,5 +21,7 @@ "author": "Kognise <felix.mattick@gmail.com>",

"scripts": {
"tsc": "tsc -p tsconfig.build.json"
"tsc": "tsc -p tsconfig.build.json",
"watch": "tsc --watch"
},
"dependencies": {
"typescript": "^3.8.3",
"uid-promise": "^1.1.0",

@@ -29,6 +31,7 @@ "ws": "^7.2.3"

"devDependencies": {
"@types/node": "^13.9.5",
"@types/ws": "^7.2.3",
"typescript": "^3.8.3"
},
"gitHead": "23aefb44f27494bab3b6b4b0ea394f1b4c2446e4"
"gitHead": "611a587b42e6320bcfa7afca71062b24d9d46994"
}

Sorry, the diff of this file is not supported yet

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