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

@acot/connection

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acot/connection - npm Package Compare versions

Comparing version 0.0.2-canary.0 to 0.0.2-canary.1

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## [0.0.2-canary.1](https://github.com/acot-a11y/acot/compare/@acot/connection@0.0.2-canary.0...@acot/connection@0.0.2-canary.1) (2020-11-03)
### Bug Fixes
- Minor bug fixes that occur during Audit ([0ec7b94](https://github.com/acot-a11y/acot/commit/0ec7b94e8f885cb45aae351d0279033367b8d94c))
## [0.0.2-canary.0](https://github.com/acot-a11y/acot/compare/@acot/connection@0.0.1...@acot/connection@0.0.2-canary.0) (2020-11-02)

@@ -8,0 +14,0 @@

2

lib/index.d.ts

@@ -14,3 +14,3 @@ export declare type ConnectionConfig = {

connect(): Promise<void>;
disconnect(): Promise<void>;
disconnect(): void;
}

@@ -7,20 +7,5 @@ "use strict";

exports.Connection = void 0;
const child_process_1 = __importDefault(require("child_process"));
const execa_1 = __importDefault(require("execa"));
const wait_on_1 = __importDefault(require("wait-on"));
const debug = require('debug')('acot:connection');
const spawn = (command) => {
const [cmd, ...args] = command.split(/\s+/);
const proc = child_process_1.default.spawn(cmd, args, {
shell: true,
});
proc.stdout.setEncoding('utf8');
proc.stderr.setEncoding('utf8');
proc.stdout.on('data', (d) => {
debug(d.toString().trim());
});
proc.stderr.on('data', (d) => {
debug(d.toString().trim());
});
return proc;
};
const waitForServer = (url, timeout) => new Promise((resolve, reject) => {

@@ -58,3 +43,9 @@ if (!url.startsWith('http')) {

debug('server process creating... (execute: "%s")', command);
this._proc = spawn(command);
this._proc = execa_1.default.command(command);
this._proc.stdout.on('data', (d) => debug(d.toString()));
this._proc.stderr.on('data', (d) => debug(d.toString()));
process.on('SIGINT', () => {
var _a;
(_a = this._proc) === null || _a === void 0 ? void 0 : _a.kill();
});
debug('server process created!');

@@ -72,18 +63,15 @@ }

}
async disconnect() {
disconnect() {
if (this._status === 'DISCONNECTED') {
return;
}
if (this._proc == null) {
debug('disconnect server connection');
return;
}
try {
debug('disconnect server connection... (pid: "%f")', this._proc.pid);
const result = this._proc.kill('SIGKILL');
debug('kill=%s', result);
}
catch (e) {
debug(e);
}
debug('disconnect server connection... (pid: "%f")', this._proc.pid);
this._proc.kill();
this._proc = null;
this._status = 'DISCONNECTED';
}
}
exports.Connection = Connection;
{
"name": "@acot/connection",
"version": "0.0.2-canary.0",
"version": "0.0.2-canary.1",
"description": "Manage the connection to the server.",

@@ -26,2 +26,3 @@ "homepage": "https://github.com/acot-a11y/acot/tree/master/packages/connection",

"debug": "^4.2.0",
"execa": "^4.1.0",
"wait-on": "^5.2.0"

@@ -36,3 +37,3 @@ },

},
"gitHead": "61cca80b5953b0ee87f2b3de4b7764ada4d057fb"
"gitHead": "f90c6232a759ad603c81f9f9e7d1383f337a46e3"
}
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