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

@aspecto/core

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aspecto/core - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

test.js

3

dist/index.js

@@ -34,3 +34,2 @@ "use strict";

: "http://localhost:8082/";
// console.log('collector address: ' + analyticsEndpoint)
let ws = new ws_1.default(analyticsEndpoint);

@@ -48,4 +47,2 @@ const http = new HttpReporter_1.default();

const collector = new collector_1.default(ws);
// collector.addCollection(new CpuCollector());
// collector.addCollection(new MemoryCollector());
collector.addCollection(new OsCollector_1.default());

@@ -52,0 +49,0 @@ collector.addCollection(new NpmCollector_1.default());

@@ -9,16 +9,7 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const socketIo = __importStar(require("socket.io-client"));
const ws_1 = __importDefault(require("ws"));
class WebSocketConnection {
constructor(host) {
this.host = host;
try {
this.localSocket = new ws_1.default("ws://127.0.0.1:7531");
this.localSocket.on("error", () => { });
}
catch (e) { }
}

@@ -38,8 +29,2 @@ auth(token) {

this.socket.on("error", function (err) {
// console.error(
// `Aspecto error while connecting to WebSocket ${err.message} ${
// err.stack
// }`,
// err
// );
reject();

@@ -49,6 +34,2 @@ });

catch (error) {
// console.error(
// `Aspecto error while connecting to WebSocket ${error}`,
// error
// );
reject();

@@ -62,5 +43,2 @@ }

this.socket.send(stringData);
if (this.localSocket && this.localSocket.readyState === ws_1.default.OPEN) {
this.localSocket.send(stringData);
}
}

@@ -67,0 +45,0 @@ }

@@ -27,2 +27,6 @@ "use strict";

this.use((req, res, next) => {
if (Math.random() >= aspectoConfig_1.default.getSamplingRatio()) {
next();
return;
}
req.aspecto = {

@@ -39,7 +43,3 @@ uuid: uuid_1.default.v4(),

};
res.finish = function () {
// console.log('in finish');
};
res.end = function (chunk) {
// console.log('in end');
if (chunk) {

@@ -46,0 +46,0 @@ chunks.push(chunk);

@@ -22,5 +22,6 @@ import WebSocketConnection from "./src/communication/ws";

: "http://localhost:8082/";
// console.log('collector address: ' + analyticsEndpoint)
let ws = new WebSocketConnection(analyticsEndpoint);
const http = new HttpReporter();
const auth = AspectoConfig.getToken(options);

@@ -31,2 +32,3 @@ http.set(ws, auth);

errorReporter.set(ws, auth);
const allowed = await ws.auth(auth);

@@ -39,4 +41,2 @@ if (!allowed) {

const collector = new Collector(ws);
// collector.addCollection(new CpuCollector());
// collector.addCollection(new MemoryCollector());
collector.addCollection(new OsCollector());

@@ -43,0 +43,0 @@ collector.addCollection(new NpmCollector());

{
"name": "@aspecto/core",
"version": "1.0.10",
"version": "1.0.11",
"description": "Aspecto metric collector",

@@ -26,5 +26,3 @@ "main": "index.js",

"husky": "^2.1.0",
"typescript": "^3.2.4"
},
"dependencies": {
"typescript": "^3.2.4",
"@types/node": "^10.12.18",

@@ -34,7 +32,8 @@ "@types/socket.io": "^2.1.2",

"@types/uuid": "^3.4.4",
"@types/ws": "^6.0.1",
"@types/ws": "^6.0.1"
},
"dependencies": {
"pidusage": "^2.0.17",
"socket.io": "^2.2.0",
"uuid": "^3.3.2",
"ws": "^6.1.2"
"uuid": "^3.3.2"
},

@@ -41,0 +40,0 @@ "husky": {

@@ -7,10 +7,5 @@ import * as socketIo from "socket.io-client";

private token: string;
private localSocket: WebSocket;
constructor(private host: string) {
try {
this.localSocket = new WebSocket("ws://127.0.0.1:7531");
this.localSocket.on("error", () => {});
} catch (e) {}
}

@@ -33,15 +28,5 @@

this.socket.on("error", function(err: any) {
// console.error(
// `Aspecto error while connecting to WebSocket ${err.message} ${
// err.stack
// }`,
// err
// );
reject();
});
} catch (error) {
// console.error(
// `Aspecto error while connecting to WebSocket ${error}`,
// error
// );
reject();

@@ -57,6 +42,3 @@ }

if (this.localSocket && this.localSocket.readyState === WebSocket.OPEN) {
this.localSocket.send(stringData);
}
}
}

@@ -48,7 +48,3 @@ import uuid from "uuid";

res.finish = function() {
// console.log('in finish');
};
res.end = function(chunk: any) {
// console.log('in end');
if (chunk) {

@@ -55,0 +51,0 @@ chunks.push(chunk);

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