Comparing version 1.0.7 to 2.0.2
69
index.js
/// <reference path="./index.ts" /> | ||
var BeautylogPlugins; | ||
(function (BeautylogPlugins) { | ||
BeautylogPlugins.init = function () { | ||
var plugins = { | ||
smartenv: require("smartenv") | ||
}; | ||
return plugins; | ||
}; | ||
})(BeautylogPlugins || (BeautylogPlugins = {})); | ||
/// <reference path="./index.ts" /> | ||
var tableHelpers = { | ||
@@ -51,8 +61,8 @@ makeRow: function (cellCounterArg, colorArg) { | ||
/// <reference path="./index.ts" /> | ||
var BeautylogOS; | ||
(function (BeautylogOS) { | ||
var BeautylogNode; | ||
(function (BeautylogNode) { | ||
function init() { | ||
var colors = require("colors"); | ||
var clc = require("cli-color"); | ||
var beautylogOS = {}; //object to append to all public facing functions | ||
var beautylogNode = {}; //object to append to all public facing functions | ||
var localBl; // object to append to all private params and functions | ||
@@ -73,3 +83,3 @@ localBl = {}; | ||
*/ | ||
beautylogOS.log = function (logText, logType) { | ||
beautylogNode.log = function (logText, logType) { | ||
if (logText === void 0) { logText = 'empty log'; } | ||
@@ -119,4 +129,4 @@ if (logType === void 0) { logType = 'normal'; } | ||
*/ | ||
beautylogOS.dir = function (logText) { | ||
return beautylogOS.log(logText, 'dir'); | ||
beautylogNode.dir = function (logText) { | ||
return beautylogNode.log(logText, 'dir'); | ||
}; | ||
@@ -128,4 +138,4 @@ /** | ||
*/ | ||
beautylogOS.error = function (logText) { | ||
return beautylogOS.log(logText, 'error'); | ||
beautylogNode.error = function (logText) { | ||
return beautylogNode.log(logText, 'error'); | ||
}; | ||
@@ -137,4 +147,4 @@ /** | ||
*/ | ||
beautylogOS.info = function (logText) { | ||
return beautylogOS.log(logText, 'info'); | ||
beautylogNode.info = function (logText) { | ||
return beautylogNode.log(logText, 'info'); | ||
}; | ||
@@ -146,4 +156,4 @@ /** | ||
*/ | ||
beautylogOS.ok = function (logText) { | ||
return beautylogOS.log(logText, 'ok'); | ||
beautylogNode.ok = function (logText) { | ||
return beautylogNode.log(logText, 'ok'); | ||
}; | ||
@@ -155,4 +165,4 @@ /** | ||
*/ | ||
beautylogOS.success = function (logText) { | ||
return beautylogOS.log(logText, 'success'); | ||
beautylogNode.success = function (logText) { | ||
return beautylogNode.log(logText, 'success'); | ||
}; | ||
@@ -164,10 +174,10 @@ /** | ||
*/ | ||
beautylogOS.warn = function (logText) { | ||
return beautylogOS.log(logText, 'warn'); | ||
beautylogNode.warn = function (logText) { | ||
return beautylogNode.log(logText, 'warn'); | ||
}; | ||
beautylogOS.table = BeautylogOsTable.init(); | ||
return beautylogOS; | ||
beautylogNode.table = BeautylogOsTable.init(); | ||
return beautylogNode; | ||
} | ||
BeautylogOS.init = init; | ||
})(BeautylogOS || (BeautylogOS = {})); | ||
BeautylogNode.init = init; | ||
})(BeautylogNode || (BeautylogNode = {})); | ||
/// <reference path="./index.ts" /> | ||
@@ -212,11 +222,12 @@ var BeautylogOsTable; | ||
/// <reference path="./typings/tsd.d.ts" /> | ||
/// <reference path="./beautylog.plugins.ts" /> | ||
/// <reference path="./beautylog.classes.ts" /> | ||
/// <reference path="./beautylog.os.ts" /> | ||
/// <reference path="./beautylog.os.table.ts" /> | ||
/// <reference path="./beautylog.node.ts" /> | ||
/// <reference path="./beautylog.node.table.ts" /> | ||
/// <reference path="./beautylog.browser.ts" /> | ||
var beautylog = function (logPlatform) { | ||
if (logPlatform === void 0) { logPlatform = "os"; } | ||
switch (logPlatform) { | ||
case "os": | ||
var beautylogOs = BeautylogOS.init(); | ||
var plugins = BeautylogPlugins.init(); | ||
var beautylog = (function () { | ||
switch (plugins.smartenv.getEnv().runtimeEnv) { | ||
case "node": | ||
var beautylogOs = BeautylogNode.init(); | ||
return beautylogOs; | ||
@@ -229,6 +240,6 @@ break; | ||
default: | ||
console.log("something is strange about the way you required beautylog"); | ||
console.log("something is strange about the platform in which you try to use beautylog"); | ||
break; | ||
} | ||
}; | ||
})(); | ||
module.exports = beautylog; |
{ | ||
"name": "beautylog", | ||
"version": "1.0.7", | ||
"version": "2.0.2", | ||
"description": "beautiful logging", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "(cd ts/compile && gulp) && (node test.js)", | ||
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)" | ||
"test": "(cd ts/compile && node compile.js) && (node ./test.js)", | ||
"testbrowser": "(npm test) && (node testbrowser.js)", | ||
"gitsetup": "(git config push.followTags true)", | ||
"push": "(git push origin master && git push origin release && git push --follow-tags)", | ||
"reinstall": "(rm -r node_modules && npm install)", | ||
"release": "(npm test) && (git pull origin master && npm version patch && git checkout release && git merge master && git checkout master && npm run push)", | ||
"update": "(git checkout master && git pull origin master) && (npm install)", | ||
"upgrade": "(npm run update) && (ncu upgradeAll && npm install)" | ||
}, | ||
@@ -29,4 +35,11 @@ "repository": { | ||
"cli-table2": "^0.1.9", | ||
"colors": "1.1.2" | ||
"colors": "1.1.2", | ||
"smartenv": "0.0.15" | ||
}, | ||
"devDependencies": { | ||
"easyserve": "0.0.4", | ||
"gulp": "^3.9.0", | ||
"gulp-browser": "0.0.18", | ||
"gulp-typescript": "^2.10.0" | ||
} | ||
} |
@@ -14,4 +14,3 @@ # beautylog | ||
### Simple Logging | ||
var bl = require('beautylog')("os"); //for use in OS console environment | ||
var bl = require('beautylog')("browser"); //for use in browser console environment like Google Chrome | ||
var bl = require('beautylog'); //for use in OS console environment AND browser console | ||
@@ -18,0 +17,0 @@ |
39
test.js
/// <reference path="./typings/tsd.d.ts" /> | ||
var beautyLogOs = require('./index.js')("os"); | ||
var beautyLogBrowser = require("./index.js")("browser"); | ||
var smartenv = require("smartenv"); | ||
var beautyLog = require('./index.js'); | ||
console.log('*** start OS console test ***'); | ||
console.log(''); | ||
console.log('declarative function calls:'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLogOs.dir('beautylog.dir(), with normal logText, without logType'); | ||
beautyLogOs.error('beautylog.error(), with normal logText, without logType'); | ||
beautyLogOs.info('beautylog.dir(), with normal logText, without logType'); | ||
beautyLogOs.ok('beautylog.ok(), with normal logText, without logType'); | ||
beautyLogOs.success('beautylog.success(), with normal logText, without logType'); | ||
beautyLogOs.warn('beautylog.warn(), with normal logText, without logType'); | ||
beautyLog.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLog.dir('beautylog.dir(), with normal logText, without logType'); | ||
beautyLog.error('beautylog.error(), with normal logText, without logType'); | ||
beautyLog.info('beautylog.dir(), with normal logText, without logType'); | ||
beautyLog.ok('beautylog.ok(), with normal logText, without logType'); | ||
beautyLog.success('beautylog.success(), with normal logText, without logType'); | ||
beautyLog.warn('beautylog.warn(), with normal logText, without logType'); | ||
console.log(''); | ||
console.log('logType String:'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "dir"', 'dir'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "error"', 'error'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "info"', 'info'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "ok"', 'ok'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"', 'success'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"', 'warn'); | ||
beautyLog.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "dir"', 'dir'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "error"', 'error'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "info"', 'info'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "ok"', 'ok'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "success"', 'success'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "warn"', 'warn'); | ||
console.log(''); | ||
console.log('*** end OS console test ***'); | ||
console.log("*** start browser console test (Might look weird in OS console and travis log...) ***"); | ||
beautyLogBrowser.log("hello"); | ||
console.log("*** end browser console test ***"); | ||
console.log("*** start table test ***"); | ||
(function () { | ||
var testTable1 = beautyLogOs.table.new("checks"); | ||
var testTable1 = beautyLog.table.new("checks"); | ||
testTable1.push(['check1', 'success']); | ||
@@ -35,3 +32,3 @@ testTable1.push(['check2', 'error']); | ||
testTable1.print(); | ||
var testTable2 = beautyLogOs.table.new("custom", ["Column1".red, "Column2".blue, "Column3".cyan]); | ||
var testTable2 = beautyLog.table.new("custom", ["Column1".red, "Column2".blue, "Column3".cyan]); | ||
testTable2.push(["Hey", "this", "works"]); | ||
@@ -38,0 +35,0 @@ testTable2.print(); |
/// <reference path="./typings/tsd.d.ts" /> | ||
/// <reference path="./beautylog.plugins.ts" /> | ||
/// <reference path="./beautylog.classes.ts" /> | ||
/// <reference path="./beautylog.os.ts" /> | ||
/// <reference path="./beautylog.os.table.ts" /> | ||
/// <reference path="./beautylog.node.ts" /> | ||
/// <reference path="./beautylog.node.table.ts" /> | ||
/// <reference path="./beautylog.browser.ts" /> | ||
var beautylog = function(logPlatform:string = "os") { | ||
switch (logPlatform) { | ||
case "os": | ||
var beautylogOs = BeautylogOS.init(); | ||
var plugins = BeautylogPlugins.init(); | ||
var beautylog = (function() { | ||
switch (plugins.smartenv.getEnv().runtimeEnv) { | ||
case "node": | ||
var beautylogOs = BeautylogNode.init(); | ||
return beautylogOs; | ||
@@ -18,6 +20,6 @@ break; | ||
default: | ||
console.log("something is strange about the way you required beautylog"); | ||
console.log("something is strange about the platform in which you try to use beautylog"); | ||
break; | ||
} | ||
}; | ||
})(); | ||
module.exports = beautylog; |
/// <reference path="./typings/tsd.d.ts" /> | ||
var beautyLogOs = require('./index.js')("os"); | ||
var beautyLogBrowser = require("./index.js")("browser"); | ||
var smartenv = require("smartenv"); | ||
var beautyLog = require('./index.js'); | ||
@@ -9,9 +9,9 @@ console.log('*** start OS console test ***'); | ||
console.log('declarative function calls:'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLogOs.dir('beautylog.dir(), with normal logText, without logType'); | ||
beautyLogOs.error('beautylog.error(), with normal logText, without logType'); | ||
beautyLogOs.info('beautylog.dir(), with normal logText, without logType'); | ||
beautyLogOs.ok('beautylog.ok(), with normal logText, without logType'); | ||
beautyLogOs.success('beautylog.success(), with normal logText, without logType'); | ||
beautyLogOs.warn('beautylog.warn(), with normal logText, without logType'); | ||
beautyLog.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLog.dir('beautylog.dir(), with normal logText, without logType'); | ||
beautyLog.error('beautylog.error(), with normal logText, without logType'); | ||
beautyLog.info('beautylog.dir(), with normal logText, without logType'); | ||
beautyLog.ok('beautylog.ok(), with normal logText, without logType'); | ||
beautyLog.success('beautylog.success(), with normal logText, without logType'); | ||
beautyLog.warn('beautylog.warn(), with normal logText, without logType'); | ||
@@ -21,9 +21,9 @@ console.log(''); | ||
console.log('logType String:'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "dir"','dir'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "error"','error'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "info"','info'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "ok"','ok'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"','success'); | ||
beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"','warn'); | ||
beautyLog.log('beautylog.log(), with normal logText, without logType'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "dir"','dir'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "error"','error'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "info"','info'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "ok"','ok'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "success"','success'); | ||
beautyLog.log('beautylog.log(), with normal logText, with logType "warn"','warn'); | ||
@@ -33,9 +33,5 @@ console.log (''); | ||
console.log("*** start browser console test (Might look weird in OS console and travis log...) ***"); | ||
beautyLogBrowser.log("hello"); | ||
console.log("*** end browser console test ***"); | ||
console.log("*** start table test ***"); | ||
(function(){ | ||
var testTable1 = beautyLogOs.table.new("checks"); | ||
var testTable1 = beautyLog.table.new("checks"); | ||
testTable1.push(['check1','success']); | ||
@@ -46,3 +42,3 @@ testTable1.push(['check2','error']); | ||
var testTable2 = beautyLogOs.table.new("custom",["Column1".red,"Column2".blue,"Column3".cyan]); | ||
var testTable2 = beautyLog.table.new("custom",["Column1".red,"Column2".blue,"Column3".cyan]); | ||
testTable2.push(["Hey","this","works"]); | ||
@@ -49,0 +45,0 @@ testTable2.print(); |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
941493
26
25954
4
4
57
9
4
+ Addedsmartenv@0.0.15
+ Addedbeautylog@1.0.7(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedsmartenv@0.0.15(transitive)