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

@squared-functions/module

Package Overview
Dependencies
Maintainers
1
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@squared-functions/module - npm Package Compare versions

Comparing version 0.9.7 to 0.9.8

46

index.js

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

/* @squared-functions/module 0.9.6
/* @squared-functions/module 0.9.8
https://github.com/anpham6/squared-functions */

@@ -9,2 +9,3 @@

const fs = require("fs");
const uuid = require("uuid");
const chalk = require("chalk");

@@ -16,13 +17,13 @@ let SETTINGS = {};

LOG_TYPE[LOG_TYPE["SYSTEM"] = 1] = "SYSTEM";
LOG_TYPE[LOG_TYPE["CHROME"] = 2] = "CHROME";
LOG_TYPE[LOG_TYPE["COMPRESS"] = 4] = "COMPRESS";
LOG_TYPE[LOG_TYPE["IMAGE"] = 8] = "IMAGE";
LOG_TYPE[LOG_TYPE["NODE"] = 16] = "NODE";
LOG_TYPE[LOG_TYPE["WATCH"] = 32] = "WATCH";
LOG_TYPE[LOG_TYPE["CLOUD_STORAGE"] = 64] = "CLOUD_STORAGE";
LOG_TYPE[LOG_TYPE["CLOUD_DATABASE"] = 128] = "CLOUD_DATABASE";
LOG_TYPE[LOG_TYPE["TIME_ELAPSED"] = 256] = "TIME_ELAPSED";
LOG_TYPE[LOG_TYPE["NODE"] = 2] = "NODE";
LOG_TYPE[LOG_TYPE["PROCESS"] = 4] = "PROCESS";
LOG_TYPE[LOG_TYPE["COMPRESS"] = 8] = "COMPRESS";
LOG_TYPE[LOG_TYPE["WATCH"] = 16] = "WATCH";
LOG_TYPE[LOG_TYPE["CLOUD_STORAGE"] = 32] = "CLOUD_STORAGE";
LOG_TYPE[LOG_TYPE["CLOUD_DATABASE"] = 64] = "CLOUD_DATABASE";
LOG_TYPE[LOG_TYPE["TIME_ELAPSED"] = 128] = "TIME_ELAPSED";
})(LOG_TYPE = exports.LOG_TYPE || (exports.LOG_TYPE = {}));
const Module = class {
constructor() {
this.tempDir = 'temp';
[this.major, this.minor, this.patch] = process.version.substring(1).split('.').map(value => +value);

@@ -65,4 +66,4 @@ }

}
getTempDir() {
return process.cwd() + path.sep + 'temp' + path.sep;
getTempDir(subDir, filename = '') {
return process.cwd() + path.sep + this.tempDir + path.sep + (subDir ? uuid.v4() + path.sep : '') + (filename.startsWith('.') ? uuid.v4() : '') + filename;
}

@@ -85,3 +86,2 @@ joinPosix(...paths) {

writeTimeElapsed(title, value, time, options = {}) {
options.hintColor || (options.hintColor = 'magenta');
this.formatMessage(LOG_TYPE.TIME_ELAPSED, title, ['Completed', (Date.now() - time) / 1000 + 's'], value, options);

@@ -104,22 +104,21 @@ }

break;
case LOG_TYPE.CHROME:
if (SETTINGS.chrome === false) {
case LOG_TYPE.PROCESS:
if (SETTINGS.process === false) {
return;
}
options.titleColor || (options.titleColor = 'magenta');
break;
case LOG_TYPE.COMPRESS:
if (SETTINGS.compress === false) {
case LOG_TYPE.NODE:
if (SETTINGS.node === false) {
return;
}
options.titleColor || (options.titleColor = 'black');
options.titleBgColor || (options.titleBgColor = 'bgWhite');
options.hintColor || (options.hintColor = 'yellow');
break;
case LOG_TYPE.IMAGE:
if (SETTINGS.image === false) {
case LOG_TYPE.COMPRESS:
if (SETTINGS.compress === false) {
return;
}
break;
case LOG_TYPE.NODE:
if (SETTINGS.node === false) {
return;
}
break;
case LOG_TYPE.WATCH:

@@ -144,2 +143,3 @@ if (SETTINGS.watch === false) {

}
options.hintColor || (options.hintColor = 'magenta');
break;

@@ -146,0 +146,0 @@ default:

{
"name": "@squared-functions/module",
"version": "0.9.7",
"version": "0.9.8",
"description": "Module extension class for squared-functions",

@@ -18,5 +18,6 @@ "main": "index.js",

"dependencies": {
"@squared-functions/types": "^0.9.7",
"@squared-functions/types": "^0.9.8",
"uuid": "^8.3.2",
"chalk": "^4.1.0"
}
}
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