node-jet
Version:
Jet Realtime Message Bus for the Web. Daemon and Peer implementation.
8 lines (7 loc) • 309 B
JavaScript
/* istanbul ignore file */
import { WebSocket as ws } from 'ws';
import { EventEmitter as ee } from 'events';
export const isNodeJs = typeof window === 'undefined';
export const isBrowser = typeof window !== 'undefined';
export const WebSocketImpl = isNodeJs ? ws : WebSocket;
export const EventEmitter = ee;