Socket
Socket
Sign inDemoInstall

node-pty

Package Overview
Dependencies
Maintainers
1
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pty - npm Package Compare versions

Comparing version 0.6.8 to 0.6.9

13

lib/index.d.ts
import { ITerminal, IPtyOpenOptions, IPtyForkOptions } from './interfaces';
import { ArgvOrCommandLine } from './types';
/**
* Forks a process as a pseudoterminal.
* @param file The file to launch.
* @param args The file's arguments as argv (string[]) or in a pre-escaped
* CommandLine format (string). Note that the CommandLine option is only
* available on Windows and is expected to be escaped properly.
* @param options The options of the terminal.
* @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
* @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
* @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
*/
export declare function spawn(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal;
/** @deprecated */
export declare function fork(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal;
/** @deprecated */
export declare function createTerminal(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal;
export declare function open(options: IPtyOpenOptions): ITerminal;
"use strict";
/**
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,2 +15,13 @@ var os = require("os");

}
/**
* Forks a process as a pseudoterminal.
* @param file The file to launch.
* @param args The file's arguments as argv (string[]) or in a pre-escaped
* CommandLine format (string). Note that the CommandLine option is only
* available on Windows and is expected to be escaped properly.
* @param options The options of the terminal.
* @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
* @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
* @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
*/
function spawn(file, args, opt) {

@@ -17,2 +32,3 @@ return new Terminal(file, args, opt);

;
/** @deprecated */
function fork(file, args, opt) {

@@ -23,2 +39,3 @@ return new Terminal(file, args, opt);

;
/** @deprecated */
function createTerminal(file, args, opt) {

@@ -25,0 +42,0 @@ return new Terminal(file, args, opt);

@@ -0,1 +1,4 @@

/**
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
export declare type ProcessEnv = {

@@ -5,10 +8,68 @@ [key: string]: string;

export interface ITerminal {
/**
* Gets the name of the process.
*/
process: string;
/**
* Writes data to the socket.
* @param data The data to write.
*/
write(data: string): void;
/**
* Resize the pty.
* @param cols The number of columns.
* @param rows The number of rows.
*/
resize(cols: number, rows: number): void;
/**
* Close, kill and destroy the socket.
*/
destroy(): void;
/**
* Kill the pty.
* @param signal The signal to send, by default this is SIGHUP. This is not
* supported on Windows.
*/
kill(signal?: string): void;
/**
* Set the pty socket encoding.
*/
setEncoding(encoding: string): void;
/**
* Resume the pty socket.
*/
resume(): void;
/**
* Pause the pty socket.
*/
pause(): void;
/**
* Alias for ITerminal.on(eventName, listener).
*/
addListener(eventName: string, listener: (...args: any[]) => any): void;
/**
* Adds the listener function to the end of the listeners array for the event
* named eventName.
* @param eventName The event name.
* @param listener The callback function
*/
on(eventName: string, listener: (...args: any[]) => any): void;
/**
* Returns a copy of the array of listeners for the event named eventName.
*/
listeners(eventName: string): Function[];
/**
* Removes the specified listener from the listener array for the event named
* eventName.
*/
removeListener(eventName: string, listener: (...args: any[]) => any): void;
/**
* Removes all listeners, or those of the specified eventName.
*/
removeAllListeners(eventName: string): void;
/**
* Adds a one time listener function for the event named eventName. The next
* time eventName is triggered, this listener is removed and then invoked.
*/
once(eventName: string, listener: (...args: any[]) => any): void;
}

@@ -15,0 +76,0 @@ export interface IPtyForkOptions {

3

lib/interfaces.js
"use strict";
/**
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interfaces.js.map

22

lib/terminal.d.ts

@@ -21,14 +21,19 @@ /// <reference types="node" />

private _checkType(name, value, type);
/** See net.Socket.end */
end(data: string): void;
/** See stream.Readable.pipe */
pipe(dest: any, options: any): any;
/** See net.Socket.pause */
pause(): Socket;
/** See net.Socket.resume */
resume(): Socket;
/** See net.Socket.setEncoding */
setEncoding(encoding: string): void;
addListener(type: string, listener: (...args: any[]) => any): void;
on(type: string, listener: (...args: any[]) => any): void;
emit(event: string, ...args: any[]): any;
listeners(type: string): Function[];
removeListener(type: string, listener: (...args: any[]) => any): void;
removeAllListeners(type: string): void;
once(type: string, listener: (...args: any[]) => any): void;
addListener(eventName: string, listener: (...args: any[]) => any): void;
on(eventName: string, listener: (...args: any[]) => any): void;
emit(eventName: string, ...args: any[]): any;
listeners(eventName: string): Function[];
removeListener(eventName: string, listener: (...args: any[]) => any): void;
removeAllListeners(eventName: string): void;
once(eventName: string, listener: (...args: any[]) => any): void;
abstract write(data: string): void;

@@ -38,2 +43,5 @@ abstract resize(cols: number, rows: number): void;

abstract kill(signal?: string): void;
/**
* Gets the name of the process.
*/
readonly abstract process: string;

@@ -40,0 +48,0 @@ redraw(): void;

"use strict";
/**
* Copyright (c) 2012-2015, Christopher Jeffrey (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,2 +10,3 @@ var events_1 = require("events");

function Terminal(opt) {
// for 'close'
this._internalee = new events_1.EventEmitter();

@@ -11,2 +16,4 @@ if (!opt) {

}
// Do basic type checks here in case node-pty is being used within JavaScript. If the wrong
// types go through to the C++ side it can lead to hard to diagnose exceptions.
this._checkType('name', opt.name ? opt.name : null, 'string');

@@ -26,14 +33,20 @@ this._checkType('cols', opt.cols ? opt.cols : null, 'number');

};
/** See net.Socket.end */
Terminal.prototype.end = function (data) {
this.socket.end(data);
};
/** See stream.Readable.pipe */
Terminal.prototype.pipe = function (dest, options) {
return this.socket.pipe(dest, options);
};
/** See net.Socket.pause */
Terminal.prototype.pause = function () {
return this.socket.pause();
};
/** See net.Socket.resume */
Terminal.prototype.resume = function () {
// TODO: Type with Socket
return this.socket.resume();
};
/** See net.Socket.setEncoding */
Terminal.prototype.setEncoding = function (encoding) {

@@ -47,11 +60,11 @@ if (this.socket._decoder) {

};
Terminal.prototype.addListener = function (type, listener) { this.on(type, listener); };
Terminal.prototype.on = function (type, listener) {
if (type === 'close') {
Terminal.prototype.addListener = function (eventName, listener) { this.on(eventName, listener); };
Terminal.prototype.on = function (eventName, listener) {
if (eventName === 'close') {
this._internalee.on('close', listener);
return;
}
this.socket.on(type, listener);
this.socket.on(eventName, listener);
};
Terminal.prototype.emit = function (event) {
Terminal.prototype.emit = function (eventName) {
var args = [];

@@ -61,3 +74,3 @@ for (var _i = 1; _i < arguments.length; _i++) {

}
if (event === 'close') {
if (eventName === 'close') {
return this._internalee.emit.apply(this._internalee, arguments);

@@ -67,14 +80,15 @@ }

};
Terminal.prototype.listeners = function (type) {
return this.socket.listeners(type);
Terminal.prototype.listeners = function (eventName) {
return this.socket.listeners(eventName);
};
Terminal.prototype.removeListener = function (type, listener) {
this.socket.removeListener(type, listener);
Terminal.prototype.removeListener = function (eventName, listener) {
this.socket.removeListener(eventName, listener);
};
Terminal.prototype.removeAllListeners = function (type) {
this.socket.removeAllListeners(type);
Terminal.prototype.removeAllListeners = function (eventName) {
this.socket.removeAllListeners(eventName);
};
Terminal.prototype.once = function (type, listener) {
this.socket.once(type, listener);
Terminal.prototype.once = function (eventName, listener) {
this.socket.once(eventName, listener);
};
// TODO: Should this be in the API?
Terminal.prototype.redraw = function () {

@@ -84,2 +98,4 @@ var _this = this;

var rows = this.rows;
// We could just send SIGWINCH, but most programs will ignore it if the
// size hasn't actually changed.
this.resize(cols + 1, rows + 1);

@@ -86,0 +102,0 @@ setTimeout(function () { return _this.resize(cols, rows); }, 30);

@@ -0,1 +1,4 @@

/**
* Copyright (c) 2017, Daniel Imms (MIT License).
*/
export declare type ArgvOrCommandLine = string[] | string;
"use strict";
/**
* Copyright (c) 2017, Daniel Imms (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

@@ -17,2 +17,5 @@ import { Terminal } from './terminal';

constructor(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions);
/**
* openpty
*/
static open(opt: IPtyOpenOptions): UnixTerminal;

@@ -22,5 +25,11 @@ write(data: string): void;

kill(signal?: string): void;
/**
* Gets the name of the process.
*/
readonly process: string;
/**
* TTY
*/
resize(cols: number, rows: number): void;
private _sanitizeEnv(env);
}
"use strict";
/**
* Copyright (c) 2012-2015, Christopher Jeffrey (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
var __extends = (this && this.__extends) || (function () {

@@ -27,2 +31,3 @@ var extendStatics = Object.setPrototypeOf ||

}
// Initialize arguments
args = args || [];

@@ -46,2 +51,4 @@ file = file || DEFAULT_FILE;

var onexit = function (code, signal) {
// XXX Sometimes a data event is emitted after exit. Wait til socket is
// destroyed.
if (!_this._emittedClose) {

@@ -56,2 +63,3 @@ if (_this._boundClose)

};
// fork
var term = pty.fork(file, args, parsedEnv, cwd, cols, rows, uid, gid, (encoding === 'utf8'), onexit);

@@ -62,4 +70,5 @@ _this.socket = new PipeSocket(term.fd);

}
_this.socket.resume();
// setup
_this.socket.on('error', function (err) {
// NOTE: fs.ReadStream gets EAGAIN twice at first:
if (err.code) {

@@ -70,3 +79,5 @@ if (~err.code.indexOf('EAGAIN')) {

}
// close
_this._close();
// EIO on exit from fs.ReadStream:
if (!_this._emittedClose) {

@@ -76,2 +87,6 @@ _this._emittedClose = true;

}
// EIO, happens when someone closes our child process: the only process in
// the terminal.
// node < 0.6.14: errno 5
// node >= 0.6.14: read EIO
if (err.code) {

@@ -82,2 +97,3 @@ if (~err.code.indexOf('errno 5') || ~err.code.indexOf('EIO')) {

}
// throw anything else
if (_this.listeners('error').length < 2) {

@@ -104,2 +120,5 @@ throw err;

}
/**
* openpty
*/
UnixTerminal.open = function (opt) {

@@ -117,2 +136,3 @@ var self = Object.create(UnixTerminal.prototype);

var encoding = opt.encoding ? 'utf8' : opt.encoding;
// open
var term = pty.open(cols, rows);

@@ -151,2 +171,4 @@ self.master = new PipeSocket(term.master);

this._close();
// Need to close the read stream so node stops reading a dead file
// descriptor. Then we can safely SIGHUP the shell.
this.socket.once('close', function () {

@@ -164,2 +186,5 @@ _this.kill('SIGHUP');

Object.defineProperty(UnixTerminal.prototype, "process", {
/**
* Gets the name of the process.
*/
get: function () {

@@ -171,2 +196,5 @@ return pty.process(this.fd, this.pty) || this.file;

});
/**
* TTY
*/
UnixTerminal.prototype.resize = function (cols, rows) {

@@ -176,6 +204,10 @@ pty.resize(this.fd, cols, rows);

UnixTerminal.prototype._sanitizeEnv = function (env) {
// Make sure we didn't start our server from inside tmux.
delete env['TMUX'];
delete env['TMUX_PANE'];
// Make sure we didn't start our server from inside screen.
// http://web.mit.edu/gnu/doc/html/screen_20.html
delete env['STY'];
delete env['WINDOW'];
// Delete some variables that might confuse our terminal.
delete env['WINDOWID'];

@@ -189,2 +221,7 @@ delete env['TERMCAP'];

exports.UnixTerminal = UnixTerminal;
/**
* Wraps net.Socket to force the handle type "PIPE" by temporarily overwriting
* tty_wrap.guessHandleType.
* See: https://github.com/chjj/pty.js/issues/103
*/
var PipeSocket = (function (_super) {

@@ -191,0 +228,0 @@ __extends(PipeSocket, _super);

@@ -0,1 +1,4 @@

/**
* Copyright (c) 2017, Daniel Imms (MIT License).
*/
export declare function assign(target: any, ...sources: any[]): any;
"use strict";
/**
* Copyright (c) 2017, Daniel Imms (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -3,0 +6,0 @@ function assign(target) {

/// <reference types="node" />
/**
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
import * as net from 'net';
import { ArgvOrCommandLine } from './types';
/**
* Agent. Internal class.
*
* Everytime a new pseudo terminal is created it is contained
* within agent.exe. When this process is started there are two
* available named pipes (control and data socket).
*/
export declare class WindowsPtyAgent {

@@ -5,0 +16,0 @@ private _inSocket;

"use strict";
/**
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,16 +10,33 @@ var net = require("net");

var pty = require(path.join('..', 'build', 'Release', 'pty.node'));
/**
* Agent. Internal class.
*
* Everytime a new pseudo terminal is created it is contained
* within agent.exe. When this process is started there are two
* available named pipes (control and data socket).
*/
var WindowsPtyAgent = (function () {
function WindowsPtyAgent(file, args, env, cwd, cols, rows, debug) {
var _this = this;
// Sanitize input variable.
cwd = path.resolve(cwd);
// Compose command line
var commandLine = argsToCommandLine(file, args);
// Open pty session.
var term = pty.startProcess(file, commandLine, env, cwd, cols, rows, debug);
// Terminal pid.
this._pid = term.pid;
this._innerPid = term.innerPid;
this._innerPidHandle = term.innerPidHandle;
// Not available on windows.
this._fd = term.fd;
// Generated incremental number that has no real purpose besides using it
// as a terminal id.
this._pty = term.pty;
// Create terminal pipe IPC channel and forward to a local unix socket.
this._outSocket = new net.Socket();
this._outSocket.setEncoding('utf8');
this._outSocket.connect(term.conout, function () {
// TODO: Emit event on agent instead of socket?
// Emit ready event.
_this._outSocket.emit('ready_datapipe');

@@ -26,2 +47,3 @@ });

this._inSocket.connect(term.conin);
// TODO: Wait for ready event?
}

@@ -66,2 +88,5 @@ Object.defineProperty(WindowsPtyAgent.prototype, "inSocket", {

exports.WindowsPtyAgent = WindowsPtyAgent;
// Convert argc/argv into a Win32 command-line following the escaping convention
// documented on MSDN (e.g. see CommandLineToArgvW documentation). Copied from
// winpty project.
function argsToCommandLine(file, args) {

@@ -68,0 +93,0 @@ if (isCommandLine(args)) {

@@ -9,4 +9,13 @@ import { Terminal } from './terminal';

constructor(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions);
/**
* openpty
*/
static open(options?: IPtyOpenOptions): void;
/**
* Events
*/
write(data: string): void;
/**
* TTY
*/
resize(cols: number, rows: number): void;

@@ -16,3 +25,6 @@ destroy(): void;

private _defer(deferredFn);
/**
* Gets the name of the process.
*/
readonly process: string;
}
"use strict";
/**
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
*/
var __extends = (this && this.__extends) || (function () {

@@ -25,2 +29,3 @@ var extendStatics = Object.setPrototypeOf ||

}
// Initialize arguments
args = args || [];

@@ -36,17 +41,33 @@ file = file || DEFAULT_FILE;

var parsedEnv = _this._parseEnv(env);
// If the terminal is ready
_this.isReady = false;
// Functions that need to run after `ready` event is emitted.
_this.deferreds = [];
// Create new termal.
_this.agent = new windowsPtyAgent_1.WindowsPtyAgent(file, args, parsedEnv, cwd, cols, rows, false);
_this.socket = _this.agent.outSocket;
// Not available until `ready` event emitted.
_this.pid = _this.agent.innerPid;
_this.fd = _this.agent.fd;
_this.pty = _this.agent.pty;
// The forked windows terminal is not available until `ready` event is
// emitted.
_this.socket.on('ready_datapipe', function () {
// These events needs to be forwarded.
['connect', 'data', 'end', 'timeout', 'drain'].forEach(function (event) {
_this.socket.on(event, function (data) {
// Wait until the first data event is fired then we can run deferreds.
if (!_this.isReady && event === 'data') {
// Terminal is now ready and we can avoid having to defer method
// calls.
_this.isReady = true;
// Execute all deferred methods
_this.deferreds.forEach(function (fn) {
// NB! In order to ensure that `this` has all its references
// updated any variable that need to be available in `this` before
// the deferred is run has to be declared above this forEach
// statement.
fn.run();
});
// Reset
_this.deferreds = [];

@@ -56,5 +77,10 @@ }

});
_this.socket.resume();
// Shutdown if `error` event is emitted.
_this.socket.on('error', function (err) {
// Close terminal session.
_this._close();
// EIO, happens when someone closes our child process: the only process
// in the terminal.
// node < 0.6.14: errno 5
// node >= 0.6.14: read EIO
if (err.code) {

@@ -64,2 +90,3 @@ if (~err.code.indexOf('errno 5') || ~err.code.indexOf('EIO'))

}
// Throw anything else.
if (_this.listeners('error').length < 2) {

@@ -69,2 +96,3 @@ throw err;

});
// Cleanup after the socket is closed.
_this.socket.on('close', function () {

@@ -81,5 +109,11 @@ _this.emit('exit', null);

}
/**
* openpty
*/
WindowsTerminal.open = function (options) {
throw new Error('open() not supported on windows, use Fork() instead.');
};
/**
* Events
*/
WindowsTerminal.prototype.write = function (data) {

@@ -91,2 +125,5 @@ var _this = this;

};
/**
* TTY
*/
WindowsTerminal.prototype.resize = function (cols, rows) {

@@ -116,5 +153,7 @@ var _this = this;

var _this = this;
// Ensure that this method is only used within Terminal class.
if (!(this instanceof WindowsTerminal)) {
throw new Error('Must be instanceof WindowsTerminal');
}
// If the terminal is ready, execute.
if (this.isReady) {

@@ -124,2 +163,3 @@ deferredFn.apply(this, null);

}
// Queue until terminal is ready.
this.deferreds.push({

@@ -130,2 +170,5 @@ run: function () { return deferredFn.apply(_this, null); }

Object.defineProperty(WindowsTerminal.prototype, "process", {
/**
* Gets the name of the process.
*/
get: function () { return this.name; },

@@ -132,0 +175,0 @@ enumerable: true,

@@ -7,3 +7,3 @@ {

},
"version": "0.6.8",
"version": "0.6.9",
"license": "MIT",

@@ -40,3 +40,4 @@ "main": "./lib/index.js",

"postinstall": "node scripts/post-install.js",
"test": "cross-env NODE_ENV=test mocha -R spec test"
"test": "cross-env NODE_ENV=test mocha -R spec test",
"prepublish": "npm run tsc"
},

@@ -43,0 +44,0 @@ "dependencies": {

@@ -8,11 +8,81 @@ /**

export interface ITerminal {
/**
* Gets the name of the process.
*/
process: string;
/**
* Writes data to the socket.
* @param data The data to write.
*/
write(data: string): void;
/**
* Resize the pty.
* @param cols The number of columns.
* @param rows The number of rows.
*/
resize(cols: number, rows: number): void;
/**
* Close, kill and destroy the socket.
*/
destroy(): void;
/**
* Kill the pty.
* @param signal The signal to send, by default this is SIGHUP. This is not
* supported on Windows.
*/
kill(signal?: string): void;
/**
* Set the pty socket encoding.
*/
setEncoding(encoding: string): void;
/**
* Resume the pty socket.
*/
resume(): void;
/**
* Pause the pty socket.
*/
pause(): void;
/**
* Alias for ITerminal.on(eventName, listener).
*/
addListener(eventName: string, listener: (...args: any[]) => any): void;
/**
* Adds the listener function to the end of the listeners array for the event
* named eventName.
* @param eventName The event name.
* @param listener The callback function
*/
on(eventName: string, listener: (...args: any[]) => any): void;
/**
* Returns a copy of the array of listeners for the event named eventName.
*/
listeners(eventName: string): Function[];
/**
* Removes the specified listener from the listener array for the event named
* eventName.
*/
removeListener(eventName: string, listener: (...args: any[]) => any): void;
/**
* Removes all listeners, or those of the specified eventName.
*/
removeAllListeners(eventName: string): void;
/**
* Adds a one time listener function for the event named eventName. The next
* time eventName is triggered, this listener is removed and then invoked.
*/
once(eventName: string, listener: (...args: any[]) => any): void;
}

@@ -19,0 +89,0 @@

@@ -87,13 +87,13 @@ /**

public addListener(type: string, listener: (...args: any[]) => any): void { this.on(type, listener); }
public on(type: string, listener: (...args: any[]) => any): void {
if (type === 'close') {
public addListener(eventName: string, listener: (...args: any[]) => any): void { this.on(eventName, listener); }
public on(eventName: string, listener: (...args: any[]) => any): void {
if (eventName === 'close') {
this._internalee.on('close', listener);
return;
}
this.socket.on(type, listener);
this.socket.on(eventName, listener);
}
public emit(event: string, ...args: any[]): any {
if (event === 'close') {
public emit(eventName: string, ...args: any[]): any {
if (eventName === 'close') {
return this._internalee.emit.apply(this._internalee, arguments);

@@ -104,16 +104,16 @@ }

public listeners(type: string): Function[] {
return this.socket.listeners(type);
public listeners(eventName: string): Function[] {
return this.socket.listeners(eventName);
}
public removeListener(type: string, listener: (...args: any[]) => any): void {
this.socket.removeListener(type, listener);
public removeListener(eventName: string, listener: (...args: any[]) => any): void {
this.socket.removeListener(eventName, listener);
}
public removeAllListeners(type: string): void {
this.socket.removeAllListeners(type);
public removeAllListeners(eventName: string): void {
this.socket.removeAllListeners(eventName);
}
public once(type: string, listener: (...args: any[]) => any): void {
this.socket.once(type, listener);
public once(eventName: string, listener: (...args: any[]) => any): void {
this.socket.once(eventName, listener);
}

@@ -120,0 +120,0 @@

@@ -84,3 +84,2 @@ /**

}
this.socket.resume();

@@ -87,0 +86,0 @@ // setup

@@ -89,5 +89,2 @@ /**

// Resume socket.
this.socket.resume();
// Shutdown if `error` event is emitted.

@@ -94,0 +91,0 @@ this.socket.on('error', err => {

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