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

@composer-js/core

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@composer-js/core - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

dist/lib/threads/ThreadWinstonTransport.js

2

dist/lib/ClassLoader.js

@@ -13,3 +13,3 @@ "use strict";

///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -16,0 +16,0 @@ const fs = require("fs");

@@ -13,3 +13,3 @@ "use strict";

///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -16,0 +16,0 @@ const child_process = require("child_process");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -6,0 +6,0 @@ const crypto = require("crypto");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -6,0 +6,0 @@ const winston = require("winston");

@@ -13,3 +13,3 @@ "use strict";

///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -16,0 +16,0 @@ const fs = require("fs");

"use strict";
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -5,0 +5,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -5,2 +5,4 @@ "use strict";

exports.ThreadPool = ThreadPool_1.default;
var ThreadWinstonTransport_1 = require("./ThreadWinstonTransport");
exports.ThreadWinstonTransport = ThreadWinstonTransport_1.default;
//# sourceMappingURL=index.js.map

@@ -13,5 +13,6 @@ "use strict";

///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2019 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////
const worker_threads_1 = require("worker_threads");
const { LEVEL, MESSAGE } = require('triple-beam');
const os = require("os");

@@ -30,4 +31,5 @@ /**

* @param restartOnExit Set to `true` to restart a worker thread on exit, otherwise set to `false`. Default is `true`.
* @param logger The Winston logger instance to forward all worker thread logs to.
*/
constructor(max = 0, restartOnExit = true) {
constructor(max = 0, restartOnExit = true, logger) {
if (max <= 0) {

@@ -38,2 +40,3 @@ max = os.cpus().length;

this.lastThread = 0;
this.logger = logger;
this.restartOnExit = restartOnExit;

@@ -86,7 +89,12 @@ this.callbacks = new Map();

}));
worker.on("message", (...args) => {
const listeners = this.callbacks.get("message");
if (listeners) {
for (const callback of listeners) {
callback(...args);
worker.on("message", (value) => {
if (value && value.type === "winston-log") {
this.logger.log(value.info[LEVEL], value.info[MESSAGE]);
}
else {
const listeners = this.callbacks.get("message");
if (listeners) {
for (const callback of listeners) {
callback(value);
}
}

@@ -93,0 +101,0 @@ }

"use strict";
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2019 AcceleratXR, Inc. All rights reserved.
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////

@@ -5,0 +5,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

export { default as ThreadPool } from "./ThreadPool";
export { default as ThreadWinstonTransport } from "./ThreadWinstonTransport";

@@ -14,2 +14,4 @@ /// <reference types="node" />

private lastThread;
/** The instance of Winston logger to forward thread logs to. */
private logger;
/** The maximum number of threads allowed. */

@@ -36,4 +38,5 @@ private maxThreads;

* @param restartOnExit Set to `true` to restart a worker thread on exit, otherwise set to `false`. Default is `true`.
* @param logger The Winston logger instance to forward all worker thread logs to.
*/
constructor(max?: number, restartOnExit?: boolean);
constructor(max?: number, restartOnExit?: boolean, logger?: any);
private createWorker;

@@ -40,0 +43,0 @@ /**

{
"name": "@composer-js/core",
"version": "1.3.0",
"version": "1.4.0",
"description": "A collection of common utilities and core functionality for composerjs applications.",

@@ -20,3 +20,3 @@ "author": "AcceleratXR, Inc. <info@acceleratxr.com>",

"build": "tsc",
"docs": "typedoc --plugin typedoc-plugin-markdown --out docs --target esnext --mode file src",
"docs": "typedoc --out docs/reference --target es6 --theme markdown --mode file src",
"test": "jest --coverage",

@@ -124,4 +124,5 @@ "test:watch": "jest --coverage --watch",

"jsonwebtoken": "^8.5.0",
"uuid": "^3.3.3"
"uuid": "^3.3.3",
"winston-transport": "^4.4.0"
}
}

@@ -1,2 +0,2 @@

# Composer: core
# Composer: Core Library

@@ -3,0 +3,0 @@ [![pipeline status](https://gitlab.com/AcceleratXR/composerjs/composer-core/badges/master/pipeline.svg)](https://gitlab.com/AcceleratXR/composerjs/composer-core/-/commits/master)

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