New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

crossws

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crossws - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

dist/shared/crossws.BS81iGZK.mjs

8

dist/adapters/bun.d.ts

@@ -0,3 +1,3 @@

import { WebSocketHandler, Server, ServerWebSocket } from 'bun';
import { AdapterInstance, AdapterOptions, Peer, Adapter } from '../index.js';
import { WebSocketHandler, Server, ServerWebSocket } from 'bun';
import '../shared/crossws.ChIJSJVK.js';

@@ -17,3 +17,3 @@

};
declare const _default: Adapter<BunAdapter, BunOptions>;
declare const bunAdapter: Adapter<BunAdapter, BunOptions>;

@@ -26,3 +26,3 @@ declare class BunPeer extends Peer<{

get remoteAddress(): string;
get context(): Record<string, unknown>;
get context(): Peer["context"];
send(data: unknown, options?: {

@@ -40,2 +40,2 @@ compress?: boolean;

export { type BunAdapter, type BunOptions, _default as default };
export { type BunAdapter, type BunOptions, bunAdapter as default };

@@ -1,7 +0,32 @@

import { Adapter, AdapterInstance, AdapterOptions } from '../index.js';
import { W as WebSocket$1 } from '../shared/crossws.ChIJSJVK.js';
import * as CF from '@cloudflare/workers-types';
import { DurableObject } from 'cloudflare:workers';
import { AdapterOptions, Adapter, AdapterInstance } from '../index.js';
import { W as WebSocket$1 } from '../shared/crossws.ChIJSJVK.js';
declare const _default: Adapter<CloudflareDurableAdapter, CloudflareOptions>;
type ResolveDurableStub = (req: CF.Request, env: unknown, context: CF.ExecutionContext) => CF.DurableObjectStub | Promise<CF.DurableObjectStub>;
interface CloudflareOptions extends AdapterOptions {
/**
* Durable Object binding name from environment.
*
* **Note:** This option will be ignored if `resolveDurableStub` is provided.
*
* @default "$DurableObject"
*/
bindingName?: string;
/**
* Durable Object instance name.
*
* **Note:** This option will be ignored if `resolveDurableStub` is provided.
*
* @default "crossws"
*/
instanceName?: string;
/**
* Custom function that resolves Durable Object binding to handle the WebSocket upgrade.
*
* **Note:** This option will override `bindingName` and `instanceName`.
*/
resolveDurableStub?: ResolveDurableStub;
}
declare const cloudflareDurableAdapter: Adapter<CloudflareDurableAdapter, CloudflareOptions>;

@@ -15,7 +40,3 @@ interface CloudflareDurableAdapter extends AdapterInstance {

}
interface CloudflareOptions extends AdapterOptions {
bindingName?: string;
instanceName?: string;
}
export { type CloudflareDurableAdapter, type CloudflareOptions, _default as default };
export { type CloudflareDurableAdapter, type CloudflareOptions, cloudflareDurableAdapter as default };

@@ -10,4 +10,4 @@ import { AdapterInstance, AdapterOptions, Adapter } from '../index.js';

}
declare const _default: Adapter<CloudflareAdapter, CloudflareOptions>;
declare const cloudflareAdapter: Adapter<CloudflareAdapter, CloudflareOptions>;
export { type CloudflareAdapter, type CloudflareOptions, _default as default };
export { type CloudflareAdapter, type CloudflareOptions, cloudflareAdapter as default };

@@ -16,4 +16,4 @@ import { AdapterInstance, AdapterOptions, Adapter } from '../index.js';

};
declare const _default: Adapter<DenoAdapter, DenoOptions>;
declare const denoAdapter: Adapter<DenoAdapter, DenoOptions>;
export { type DenoAdapter, type DenoOptions, _default as default };
export { type DenoAdapter, type DenoOptions, denoAdapter as default };
import { AdapterInstance, AdapterOptions, Adapter } from '../index.js';
import { IncomingMessage as IncomingMessage$1 } from 'node:http';
import { Duplex as Duplex$1 } from 'node:stream';
import { IncomingMessage, Server as Server$1, ClientRequestArgs, ClientRequest, OutgoingHttpHeaders, Agent } from 'node:http';
import { Duplex, DuplexOptions } from 'node:stream';
import { EventEmitter } from 'events';
import { IncomingMessage, Server as Server$1, ClientRequestArgs, ClientRequest, OutgoingHttpHeaders, Agent } from 'http';
import { Server as Server$2 } from 'https';
import { Duplex, DuplexOptions } from 'stream';
import { SecureContextOptions } from 'tls';
import { URL } from 'url';
import { ZlibOptions } from 'zlib';
import { Server as Server$2 } from 'node:https';
import { SecureContextOptions } from 'node:tls';
import { URL } from 'node:url';
import { ZlibOptions } from 'node:zlib';
import '../shared/crossws.ChIJSJVK.js';

@@ -291,3 +289,3 @@

interface NodeAdapter extends AdapterInstance {
handleUpgrade(req: IncomingMessage$1, socket: Duplex$1, head: Buffer): void;
handleUpgrade(req: IncomingMessage, socket: Duplex, head: Buffer): void;
closeAll: (code?: number, data?: string | Buffer) => void;

@@ -299,4 +297,4 @@ }

}
declare const _default: Adapter<NodeAdapter, NodeOptions>;
declare const nodeAdapter: Adapter<NodeAdapter, NodeOptions>;
export { type NodeAdapter, type NodeOptions, _default as default };
export { type NodeAdapter, type NodeOptions, nodeAdapter as default };

@@ -10,4 +10,4 @@ import { AdapterInstance, AdapterOptions, Adapter } from '../index.js';

}
declare const _default: Adapter<SSEAdapter, SSEOptions>;
declare const sseAdapter: Adapter<SSEAdapter, SSEOptions>;
export { type SSEAdapter, type SSEOptions, _default as default };
export { type SSEAdapter, type SSEOptions, sseAdapter as default };

@@ -20,3 +20,3 @@ import { AdapterInstance, AdapterOptions, Adapter, Peer } from '../index.js';

}
declare const _default: Adapter<UWSAdapter, UWSOptions>;
declare const uwsAdapter: Adapter<UWSAdapter, UWSOptions>;

@@ -36,2 +36,3 @@ declare class UWSPeer extends Peer<{

subscribe(topic: string): void;
unsubscribe(topic: string): void;
publish(topic: string, message: string, options?: {

@@ -59,2 +60,2 @@ compress?: boolean;

export { type UWSAdapter, type UWSOptions, _default as default };
export { type UWSAdapter, type UWSOptions, uwsAdapter as default };
import { W as WebSocket } from './shared/crossws.ChIJSJVK.js';
declare const kNodeInspect: unique symbol;
interface AdapterInternal {

@@ -35,2 +37,4 @@ ws: unknown;

get peers(): Set<Peer>;
/** All topics, this peer has been subscribed to. */
get topics(): Set<string>;
abstract close(code?: number, reason?: string): void;

@@ -53,3 +57,4 @@ /** Abruptly close the connection */

[Symbol.toPrimitive](): string;
[Symbol.toStringTag](): string;
[Symbol.toStringTag](): "WebSocket";
[kNodeInspect](): Record<string, unknown>;
}

@@ -90,3 +95,3 @@

*/
uint8Array(): Uint8Array<ArrayBufferLike>;
uint8Array(): Uint8Array;
/**

@@ -119,2 +124,5 @@ * Get data as [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or [SharedArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) value.

[Symbol.toPrimitive](): string;
[kNodeInspect](): {
data: unknown;
};
}

@@ -121,0 +129,0 @@

@@ -1,10 +0,3 @@

declare const _default: {
new (url: string | URL, protocols?: string | string[]): WebSocket;
prototype: WebSocket;
readonly CONNECTING: 0;
readonly OPEN: 1;
readonly CLOSING: 2;
readonly CLOSED: 3;
};
declare const WebSocket: typeof globalThis.WebSocket;
export { _default as default };
export { WebSocket as default };

@@ -1,10 +0,3 @@

declare const _default: {
new (url: string | URL, protocols?: string | string[]): WebSocket;
prototype: WebSocket;
readonly CONNECTING: 0;
readonly OPEN: 1;
readonly CLOSING: 2;
readonly CLOSED: 3;
};
declare const Websocket: typeof globalThis.WebSocket;
export { _default as default };
export { Websocket as default };
{
"name": "crossws",
"version": "0.3.3",
"version": "0.3.4",
"description": "Cross-platform WebSocket Servers for Node.js, Deno, Bun and Cloudflare Workers",

@@ -90,22 +90,22 @@ "repository": "unjs/crossws",

"devDependencies": {
"@cloudflare/workers-types": "^4.20250124.3",
"@types/bun": "^1.2.0",
"@cloudflare/workers-types": "^4.20250204.0",
"@types/bun": "^1.2.2",
"@types/deno": "^2.0.0",
"@types/eventsource": "^1.1.15",
"@types/node": "^22.10.10",
"@types/web": "^0.0.198",
"@types/node": "^22.13.1",
"@types/web": "^0.0.202",
"@types/ws": "^8.5.14",
"@vitest/coverage-v8": "^3.0.4",
"@vitest/coverage-v8": "^3.0.5",
"automd": "^0.3.12",
"changelogen": "^0.5.7",
"consola": "^3.4.0",
"eslint": "^9.18.0",
"eslint": "^9.20.0",
"eslint-config-unjs": "^0.4.2",
"eventsource": "^3.0.2",
"eventsource": "^3.0.5",
"execa": "^9.5.2",
"get-port-please": "^3.1.2",
"h3": "^1.14.0",
"h3": "^1.15.0",
"jiti": "^2.4.2",
"listhen": "^1.9.0",
"prettier": "^3.4.2",
"prettier": "^3.5.0",
"typescript": "^5.7.3",

@@ -115,7 +115,7 @@ "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.44.0",

"undici": "^7.3.0",
"vitest": "^3.0.4",
"wrangler": "^3.105.1",
"vitest": "^3.0.5",
"wrangler": "^3.107.3",
"ws": "^8.18.0"
},
"packageManager": "pnpm@9.15.4"
"packageManager": "pnpm@10.2.1"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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